2

I am using JitPack to share a private Github release that I manage. I have uploaded a new release version to github successfully - when I download it as jar from Github, I see the correct files. But when I use pom.xml to download it as a dependency via the pom.xml file, it downloads an earlier release version. I ran mvn dependency:list to see what is actually being downloaded and it says that the correct version is the one being downloaded.

    [INFO]    com.github.myGroupId:my-artifact-id:jar:THE_CORRECT_VERSION:compile

But when I browse in the jar classes I see that it is still the old version.

The solutions I tried so far:
-submitting another new release
-cleaning my maven local repository

All didn't work. I still get the old version.

The pom.xml code:


 <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.shai.test</groupId>
    <artifactId>sandbox</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.github.myGroupId</groupId>
            <artifactId>my-artifact-id</artifactId>
            <version>MY_LATEST_VERSION</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>

</project>


Shai Givati
  • 1,106
  • 1
  • 10
  • 24
  • 1
    I don't see any log files nor the real (full) pom file nor the real jitpack area etc. ? How could I guess what might be wrong ? – khmarbaise Oct 06 '19 at 08:59
  • Use `mvn dependency:list` on the project to find out which dependencies are used. – J Fabian Meier Oct 06 '19 at 12:08
  • @khmarbaise I added the pom file. As JF Meier suggested, I also added the dependency:list command results, but there are no relevant other logs (for my knowledge) that I can provide. Is there a specific log you're referring to? – Shai Givati Oct 07 '19 at 06:38
  • With JitPack, version are referenced by git references, **NOT** by the `version` code from the POM. Specifying e.g. `master-SNAPSHOT` will ensure you will always get the latest release from the master branch. Note that the group ID typically needs to be `com.github.USER`, not what is in the POM for the jar. – user149408 Jan 21 '21 at 20:24

0 Answers0