buddyp450
buddyp450

Reputation: 572

How to instruct java gradle plugin to not use the root project name to construct the module jar?

As part of my CI process a symlink directory is made with an arbitrary name like "module" that will always point to the correct build directory. Unfortunately the java plugin seems to use this when it decides to name the resulting JAR file module.jar.

How do I tell gradle to use some other properties in order to determine the jar name?

Upvotes: 1

Views: 785

Answers (1)

Vampire
Vampire

Reputation: 38619

You have several options to achieve this, here are some of them:

  • set the rootProject.name in settings.gradle to make it independent of the directory name (always a good idea)
  • set the archivesBaseName on the project to influence the base name of all archive tasks
  • set the baseName on the jar task to whatever you like
  • set the archiveName on the jar task to whatever you like

Upvotes: 3

Related Questions