community.general icon indicating copy to clipboard operation
community.general copied to clipboard

[maven_artifact] can not download the latest snapshot version of an artifact

Open pascalbe-dev opened this issue 1 year ago • 2 comments

Summary

I got a maven repository with multiple artifacts deployed to one snapshot version (0.0.1-SNAPSHOT). They are then all saved with their timestamps in this one version.

When I try to download the snapshot version of an artifact I always get the first version which has been pushed to that snapshot version. Instead, I would always want to get the latest version.

The reason could be the order in the implementation. This idea resulted from this stackoverflow answer.

Issue Type

Bug Report

Component Name

maven_artifact

Ansible Version

$ ansible --version
2.10.8

Community.general Version

$ ansible-galaxy collection list community.general
1.3.6

Configuration

$ ansible-config dump --only-changed
_nothing_

OS / Environment

NAME="Oracle Linux Server" VERSION="7.9" ID="ol" ID_LIKE="fedora" VARIANT="Server" VARIANT_ID="server" VERSION_ID="7.9" PRETTY_NAME="Oracle Linux Server 7.9"

Steps to Reproduce

- name: download artifact
  maven_artifact:
    artifact_id: artifact
    group_id: group.id
    version: 0.0.1-SNAPSHOT
    repository_url: https://maven.pkg.github.com/org/repo
    extension: jar
    username: "{{ githubUsername }}"
    password: "{{ githubRepoToken }}"
    dest: /home/{{ ansible_user }}/automation/artifacts/

Expected Results

I expected to get the latest timestamp of this snapshot version.

Actual Results

I got the earliest timestamp of this snapshot version.

Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

pascalbe-dev avatar Aug 13 '22 10:08 pascalbe-dev

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Aug 13 '22 10:08 ansibullbot

cc @tumbl3w33d @turb click here for bot help

ansibullbot avatar Aug 13 '22 10:08 ansibullbot

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Nov 09 '22 10:11 ansibullbot