views:

20

answers:

1

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?

+1  A: 

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}
Pascal Thivent
Unfortunatley it's not that simple as I'm building an OSGI bundle using the maven-bundle-plugin, which means that my packaging is set to "bundle".
mmccomb