Gradle remove version number from dependency name

I would like to use the derbyrun.jar generated by the Apache Derby project in my application to start the derby database as a Windows or Linux service.

The problem is that derbyrun.jar is referenced in its manifest other derby bars without version number in their names, for example Class-Path: derby.jar derbyclient.jar derbytools.jar derbynet.jar

. Although my application (with many sub-projects) is using the "maven / gradle" format derby-10.13.1.1.jar, derbyclient-10.13.1.1.jar, etc.

.

Is there an easy way in gradle to name these derby cans without version number like

compile("org.apache.derby:derby:10.11.1.1") {
  artifact {
    name = 'derby'
  }
}

      

which should only lead to derby.jar

.

I don't like the idea of ​​renaming derby-10.13.1.1.jar

to derby.jar

in a separate issue as we refer to these artifact names in many places using configurations.runtime

etc. (like when deploying or creating manifest files for our own jars). And this renaming approach seems to make the script unnecessary (+ all subsequent maintenance efforts when the derby version is changed).

Is there a better way to achieve this? Of course the one mentioned above artifact { name = 'derby' }

doesn't remove the version number from the jar filename.

+3


source to share





All Articles