Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwriting dependencies of multi-module project with wrong group and version #4112

Closed
nedtwigg opened this issue Dec 30, 2019 · 2 comments
Closed

Comments

@nedtwigg
Copy link

Describe the bug
When referencing a specific commit of a multi-module project, JitPack rewrites the POM so that the other modules in project also get downloaded at the same commit. The bug is that JitPack is also rewriting other entries in the POM, in an unpredictable pattern.

To Reproduce
The latest POM published to mavenCentral is here, condensed below:

com.diffplug.spotless:spotless-plugin-gradle:3.26.1
<dependencies>
com.diffplug.spotless:spotless-lib:1.26.1
com.diffplug.spotless:spotless-lib-extra:1.26.1
com.diffplug.durian:durian-core:1.2.0
com.diffplug.durian:durian-io:1.2.0
com.diffplug.durian:durian-collect:1.2.0
</dependencies>

For this commit, (buildlog), the resultant POM is here, condensed below:

com.diffplug.spotless:spotless-plugin-gradle:228aa3...
<dependencies>
com.diffplug.spotless:spotless-lib:228aa3...
com.diffplug.spotless:spotless-lib-extra:228aa3...
com.diffplug.spotless:durian-core:228aa3...    <-- error: rewrote group and version
com.diffplug.durian:durian-io:1.2.0            <-- ok: did not rewrite group and version
com.diffplug.spotless:durian-collect:228aa3... <-- error: rewrote group and version again
</dependencies>

Expected behavior
I would expect that only the modules in the multi-module project would be rewritten. In this case, that would mean spotless-lib and spotless-lib-extra. It's especially confusing that durian-core and durian-collect are being rewritten, while durian-io is being left alone.

Additional context
We have purchased a custom group, com.diffplug, which we are using above. But we get the same result at the com.github.diffplug location as well.

@nedtwigg nedtwigg changed the title JitPack is overwriting dependencies of multi-module project with wrong group and version Overwriting dependencies of multi-module project with wrong group and version Dec 30, 2019
nedtwigg added a commit to diffplug/spotless that referenced this issue Dec 31, 2019
@jitpack-io
Copy link
Member

Hi,

JitPack is looking for .pom files in the build directory and then checks if they've been installed in ~/.m2. For all found artifacts it will rewrite group and version.
In this case it found durian-core and durian-collect in:

  • ./plugin-maven/build/localMavenRepository/com/diffplug/durian/durian-core/1.2.0/durian-core-1.2.0.pom
  • ./plugin-maven/build/localMavenRepository/com/diffplug/durian/durian-collect/1.2.0/durian-collect-1.2.0.pom

@nedtwigg
Copy link
Author

Fascinating! Thanks very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants