jitpack.io
jitpack.io copied to clipboard
Maven Plugin's descriptor contains the wrong version.
After adding dependency through jitpack i'm getting the following error:
Invalid plugin descriptor for com.github.temyers:cucumber-jvm-parallel-plugin:f6d7c3029d (Plugin's descriptor contains the wrong version: 1.3.0-SNAPSHOT -> [Help 1]
This happens when im trying to fetch a branch as a dependency. It would seem for the solution to be to rewrite the xml file and replace 1.3.0-SNAPSHOT with the commit hash.
Is it possible to override the version in plugin's descriptor during build time? Perhaps it can be replaced with the version that was requested through JitPack
Not through maven I think. I believe it has to be solved on the server side during build where jitpack then would replace the version in the pom.xml file.
oldId="org.old.groupId"
newId="org.new.groupId"
find . -name "pom.xml" \
| xargs sed -i "s/<groupId>${oldId}<\/groupId>/<groupId>${newId}<\/groupId>/g"
Haven't tested it myself, but it seems legit.
Same issue on SBT with dependencies in a branch.
java.text.ParseException: inconsistent module descriptor file found in 'https://jitpack.io/com/github/myorg/repo/submodule_2.11/develop-b2122a75b1-1/submodule_2.11-develop-b2122a75b1-1.pom': bad revision: expected='develop-b2122a75b1-1' found='develop-SNAPSHOT';
JIC the workaround:
- create
jitpack.yml
file at the root of your repo - put the command to override version into it:
before_install:
- find . -name "pom.xml" | xargs sed -i "s/<version>master-SNAPSHOT<\/version>/<version>${VERSION}<\/version>/g"
Here I suppose that your master has a version master-SNAPSHOT
, ${VERSION}
is a variable provided by Jitpack.
See Jitpack Build Environment and Jitpack Custom Commands.
This is also a problem when you need to use com.github.xxx
as the group ID but don't want to or can't easily change the "real" group ID to match