Skip to content

Cannot retrieve snapshot dependencies #29

Closed
@ruzkant

Description

@ruzkant

This is against version 2.1.2.

I have two problems. If I publish sources, which is published after the jar, then when gradle tries to retrieve the latest jar it does this:

http://localhost:4567/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/maven-metadata.xml
http://localhost:4567/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/iPayUtils-1.53-20200513.061306-4-sources-2.pom
http://localhost:4567/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/iPayUtils-1.53-20200513.061306-4-sources-2.jar

So it only retrieves sources. Probably thinks that is the latest artifact.

If I don't publish sources then gradle ends up asking for this:
http://localhost:4567/snapshot/xx/xx/xxx/xxxxx/1.53-SNAPSHOT/xxxxx-1.53-20200513.063347-1-1.jar

The build number is repeated at the end and so it doesn't find it. The maven-metadata.xml downloaded is:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
    <groupId>xxx</groupId>
    <artifactId>xxx</artifactId>
    <version>1.53</version>
    <versioning>
        <release>xxx-1.53-20200513.063347-1</release>
        <latest>xxx-1.53-20200513.063347-1</latest>
        <snapshot>
            <timestamp>20200513.063347-1</timestamp>
            <buildNumber>1</buildNumber>
        </snapshot>
        <snapshotVersions>
            <snapshotVersion>
                <extension>jar</extension>
                <value>xxx-1.53-20200513.063347-1</value>
                <updated>20200513.063347-1</updated>
            </snapshotVersion>
        </snapshotVersions>
        <lastUpdated>20200513063347</lastUpdated>
    </versioning>
</metadata>

This is what I get from artifactory for the same setup. A few difference I don't know the impact of, but the updated field looks different and does not include the build number, maybe that's the issue?

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>xxx</groupId>
  <artifactId>xxx</artifactId>
  <version>1.53-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20200513.063915</timestamp>
      <buildNumber>1</buildNumber>
    </snapshot>
    <lastUpdated>20200513063916</lastUpdated>
    <snapshotVersions>
      <snapshotVersion>
        <extension>jar</extension>
        <value>1.53-20200513.063915-1</value>
        <updated>20200513063915</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>pom</extension>
        <value>1.53-20200513.063915-1</value>
        <updated>20200513063915</updated>
      </snapshotVersion>
    </snapshotVersions>
  </versioning>
</metadata>

Activity

dzikoysk

dzikoysk commented on May 13, 2020

@dzikoysk
Owner

Oh, thanks for a metadata generated by the Artifactory. Maven has lacks in docs and it's why some of fields contain different values. Could you also provide log from NanoMaven console?

added
bugBugs & errors found in Reposilite
on May 13, 2020
added a commit that references this issue on May 13, 2020

GH-29 Modify field values in generated maven-metadata file

399899a
dzikoysk

dzikoysk commented on May 13, 2020

@dzikoysk
Owner

Try again with 2.1.2. I think that the proper values in metadata file should fix this problem.

ruzkant

ruzkant commented on May 14, 2020

@ruzkant
Author

Great, thx. Now if I only publish main jar it works, but if I also publish source jar it still has issues.

After first publish with sources:

Nano log:

/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/maven-metadata.xml HEAD
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/maven-metadata.xml GET
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191010-1-sources.pom GET
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191010-1-sources.jar HEAD
19:11:58.614 INFO | Available: 155707; mime: application/x-java-archive; size: 155707; file: repositories/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191010-1-sources.jar
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191010-1-sources.jar GET
19:12:00.247 INFO | Available: 155707; mime: application/x-java-archive; size: 155707; file: repositories/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191010-1-sources.jar

folder contents:

xxxx-1.53-20200514.191010-1.jar       xxxx-1.53-20200514.191010-1.pom       xxxx-1.53-20200514.191010-1-sources.jar       maven-metadata.xml
xxxx-1.53-20200514.191010-1.jar.md5   xxxx-1.53-20200514.191010-1.pom.md5   xxxx-1.53-20200514.191010-1-sources.jar.md5   maven-metadata.xml.md5
xxxx-1.53-20200514.191010-1.jar.sha1  xxxx-1.53-20200514.191010-1.pom.sha1  xxxx-1.53-20200514.191010-1-sources.jar.sha1  maven-metadata.xml.sha1

metadata.xml:

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>xx.xx.xxx</groupId>
  <artifactId>xxxx</artifactId>
  <version>1.53-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20200514.191010</timestamp>
      <buildNumber>1</buildNumber>
    </snapshot>
    <lastUpdated>20200514191010</lastUpdated>
  </versioning>
</metadata>

After second publish with sources:

Nano log:

/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/maven-metadata.xml HEAD
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/maven-metadata.xml GET
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191329-1-sources.pom GET
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191329-1-sources.jar HEAD
19:14:01.500 INFO | Available: 155707; mime: application/x-java-archive; size: 155707; file: repositories/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191329-1-sources.jar
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191329-1-sources.jar HEAD
19:14:03.026 INFO | Available: 155707; mime: application/x-java-archive; size: 155707; file: repositories/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191329-1-sources.jar
/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191329-1-sources.jar.sha1 GET
19:14:03.744 INFO | Available: 40; mime: text/plain; size: 40; file: repositories/snapshot/xx/xx/xxx/xxxx/1.53-SNAPSHOT/xxxx-1.53-20200514.191329-1-sources.jar.sha1

folder contents:

xxxx-1.53-20200514.191010-1.jar       xxxx-1.53-20200514.191010-1-sources.jar       xxxx-1.53-20200514.191329-1.pom               maven-metadata.xml
xxxx-1.53-20200514.191010-1.jar.md5   xxxx-1.53-20200514.191010-1-sources.jar.md5   xxxx-1.53-20200514.191329-1.pom.md5           maven-metadata.xml.md5
xxxx-1.53-20200514.191010-1.jar.sha1  xxxx-1.53-20200514.191010-1-sources.jar.sha1  xxxx-1.53-20200514.191329-1.pom.sha1          maven-metadata.xml.sha1
xxxx-1.53-20200514.191010-1.pom       xxxx-1.53-20200514.191329-1.jar               xxxx-1.53-20200514.191329-1-sources.jar
xxxx-1.53-20200514.191010-1.pom.md5   xxxx-1.53-20200514.191329-1.jar.md5           xxxx-1.53-20200514.191329-1-sources.jar.md5
xxxx-1.53-20200514.191010-1.pom.sha1  xxxx-1.53-20200514.191329-1.jar.sha1          xxxx-1.53-20200514.191329-1-sources.jar.sha1

Note here the missing classifier xml field for source jars...

metadata.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<metadata>
    <groupId>xx.xx.xxx</groupId>
    <artifactId>xxxx</artifactId>
    <version>1.53-SNAPSHOT</version>
    <versioning>
        <snapshot>
            <timestamp>20200514.191329-1</timestamp>
            <buildNumber>sources</buildNumber>
        </snapshot>
        <snapshotVersions>
            <snapshotVersion>
                <extension>jar</extension>
                <value>1.53-20200514.191329-1-sources</value>
                <updated>20200514191330</updated>
            </snapshotVersion>
            <snapshotVersion>
                <extension>pom</extension>
                <value>1.53-20200514.191329-1-sources</value>
                <updated>20200514191330</updated>
            </snapshotVersion>
            <snapshotVersion>
                <extension>jar</extension>
                <value>1.53-20200514.191329-1</value>
                <updated>20200514191335</updated>
            </snapshotVersion>
            <snapshotVersion>
                <extension>pom</extension>
                <value>1.53-20200514.191329-1</value>
                <updated>20200514191335</updated>
            </snapshotVersion>
            <snapshotVersion>
                <extension>jar</extension>
                <value>1.53-20200514.191010-1-sources</value>
                <updated>20200514191013</updated>
            </snapshotVersion>
            <snapshotVersion>
                <extension>pom</extension>
                <value>1.53-20200514.191010-1-sources</value>
                <updated>20200514191013</updated>
            </snapshotVersion>
            <snapshotVersion>
                <extension>jar</extension>
                <value>1.53-20200514.191010-1</value>
                <updated>20200514191017</updated>
            </snapshotVersion>
            <snapshotVersion>
                <extension>pom</extension>
                <value>1.53-20200514.191010-1</value>
                <updated>20200514191017</updated>
            </snapshotVersion>
        </snapshotVersions>
        <lastUpdated>20200514191330</lastUpdated>
    </versioning>
</metadata>

Example from artifactory for another lib showing the :

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>xx.xx.xxx</groupId>
  <artifactId>xxxx</artifactId>
  <version>1.31-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <timestamp>20181107.045601</timestamp>
      <buildNumber>1</buildNumber>
    </snapshot>
    <lastUpdated>20181107045613</lastUpdated>
    <snapshotVersions>
      <snapshotVersion>
        <classifier>sources</classifier>
        <extension>jar</extension>
        <value>1.31-20181107.045601-1</value>
        <updated>20181107045601</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>jar</extension>
        <value>1.31-20181107.045601-1</value>
        <updated>20181107045601</updated>
      </snapshotVersion>
      <snapshotVersion>
        <extension>pom</extension>
        <value>1.31-20181107.045601-1</value>
        <updated>20181107045601</updated>
      </snapshotVersion>
    </snapshotVersions>
  </versioning>
</metadata>
dzikoysk

dzikoysk commented on May 14, 2020

@dzikoysk
Owner

Well, it looks like a mess, but as far as I conclude, we just need a proper support for classifiers and then it should work 🤔

added a commit that references this issue on May 15, 2020

GH-29 Support classifiers (Resolve #37)

6459db1
dzikoysk

dzikoysk commented on May 15, 2020

@dzikoysk
Owner

2.2.0 supports proper classifiers. You have to remove old configuration to launch this version due to #35

ruzkant

ruzkant commented on May 15, 2020

@ruzkant
Author

Thanks that resolves it!

dzikoysk

dzikoysk commented on May 15, 2020

@dzikoysk
Owner

Oof, finally. Thanks for details and your time during this process :)

dzikoysk

dzikoysk commented on May 15, 2020

@dzikoysk
Owner
added 2 commits that reference this issue on Jul 8, 2022

GH-29 Modify field values in generated maven-metadata file

GH-29 Support classifiers (Resolve #37)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBugs & errors found in Reposilite

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dzikoysk@ruzkant

        Issue actions

          Cannot retrieve snapshot dependencies · Issue #29 · dzikoysk/reposilite