gradleliferay-7bnd

Generate jar with Bundle-SymbolicName value in a Liferay module


By default, Blade generates the jar file of a module including the module version.

Searching information about how to remove the version from de filename, I was success change the jar's name with only the project name using this code in the workspace build.gradle file:

allprojects {
    apply plugin: 'java'
    jar.archiveFileName = "${project.name}.jar"
}

Now, I'm trying to use the symbolic name of the module (the value from the Bundle-SymbolicName attribute in bnd.bnd file) to generate the jar, but I can't find the way to get it from the build.gradle file.

Is there way to do it?


Solution

  • Finally, the solution was quite simple. When using the deploy task from the Liferay plugin in IntelliJ, it generates the .jar file with the version in the build/libs directory of the module, but deploys it to the server (directory bundles/osgi/modules) without the version.