How to keep long version jar from maven repository


(Omar Fernández) #1

Hi everybody,

I tried to make my first assembly script with gradle. I used to make that task with appassembler-maven-plugin maven plugin. Because that build was made for testing purpose, I needed to include jars with long version like bitrate-1.0-20120719.152340-1.jar, and this dependency was named bitrate-1.0-SNAPHOST.jar

The build was created with all its dependencies, but SNAPSHOT jars didn’t change its long version. It kept the SNAPSHOT suffix.

Anybody know how to change SNAPSHOT to long version?

I tried to use rename in the copy task, but long version was missing.

My gradle code:

dependencies {
 compile 'com.acme.proj:bitrate:1.0-SNAPSHOT'
}
  repositories {
 maven{ url 'http://IP:PORT/nexus/content/repositories/snapshots/' }
}
task copyLibs(type: Copy) {
    into "$RELEASE_LIB_DIR/"
    from configurations.compile
}
...//other tasks

(Peter Niederwieser) #2

As far as I know, Gradle doesn’t currently support automatic conversion from ‘SNAPSHOT’ to the long version. Hence you have two options:

  • Refer to the artifact by its long version in the ‘dependencies {}’ block * Rename the library during the copy operation (but then you’ll have to know what to rename it to)