Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven finalName Property Missing Artifact Extension

I'm writing a Maven plugin that takes as a parameter the path to the .jar file built by the project. At the moment I'm using the following definition for my configuration variable within my Mojo class...

/**
 * Location of the built artifact
 * @parameter expression="${project.build.finalName}
 * @required
 */
private File path;

The ${project.build.finalName} property returns the path to the built artifact but does not contain the file extension. So if my build produced a file called TheBuiltJar-1.0.jar my path variable's path points to TheBuiltJar-1.0 - which isn't a valid file path.

Is there another maven property that contains the full path and extension? Or even another property that contains just the extension?

like image 919
mmccomb Avatar asked Oct 01 '10 11:10

mmccomb


1 Answers

Is there another maven property that contains the full path and extension? Or even another property that contains just the extension?

Aren't you looking for:

${project.build.directory}/${project.build.finalName}.${project.packaging}
like image 109
Pascal Thivent Avatar answered Oct 27 '22 00:10

Pascal Thivent