jitpack.io icon indicating copy to clipboard operation
jitpack.io copied to clipboard

Maven Plugin's descriptor contains the wrong version.

Open netbrain opened this issue 8 years ago • 6 comments

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.

netbrain avatar May 27 '16 09:05 netbrain

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

jitpack-io avatar May 27 '16 13:05 jitpack-io

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.

netbrain avatar May 27 '16 13:05 netbrain

From stackoverflow:

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.

Tzrlk avatar May 02 '17 02:05 Tzrlk

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';

nrktkt avatar May 15 '17 23:05 nrktkt

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.

vsbogd avatar Jun 09 '21 17:06 vsbogd

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

jdimeo avatar Dec 03 '21 15:12 jdimeo