mardi 25 août 2015

Maven property visibilily to plugins

There appear to be some subtleties regarding properties in Maven that trip me up. I'm trying to use the jboss-as-maven-plugin, in particular mvn jboss-as:deploy.

Running this first invokes all phases up to package. At validate, I have the buildnumber maven plugin config'd to create the build number. It runs successfully:

[INFO] Storing buildNumber: 25-Aug-2015-5 at timestamp: 1440522013153

At some later phase, this:

<finalName>${project.artifactId}-${project.version}-r${buildNumber}</finalName>

kicks in, apparently successfully, because the .ear I'm building is given the correct filename:

[INFO] Building jar: /home/johndoe/myproj/target/Myproj-1.2.3-SNAPSHOT-r25-Aug-2015-5.ear

Then, when the jboss-as-maven-plugin tries to pick up the file in order to deploy it, it apparently can't resolve the 'buildNumber' property, and complains:

[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.7.Final:deploy (default-cli) on project Quark: Error executing FORCE_DEPLOY: /home/johndoe/myproj/target/Myproj-1.2.3-SNAPSHOT-r${buildNumber}.ear (No such file or directory) -> [Help 1]

Apparently the plugin managed to resolve the other parts that make up the filename, ${project.artifactId} and ${project.version}, but fails to do the same with ${buildNumber} .

Do I need to put something into the pom that tells the buildnumber plugin to 'export' that property, or similar?



from Newest questions tagged java - Stack Overflow http://ift.tt/1WQDxCP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire