Debug Maven to find out the war file name that has been created
I am getting this exception in Maven2 when i run mvn deploy
Please see the error
[INFO] An Ant BuildException has occured: Warning: Could not find file D:\bayer\service\target\${file.name}.war to copy.
I have this below line under my POM.xml file
Please tell me is it possible to see the file.name that is forming at runtime ??
I have this line under my POM.xml file
<copy file="${project.build开发者_JAVA百科.directory}/${file.name}.${project.packaging}" tofile="${deploy.home}/${webapps.dir}/${file.name}.${project.packaging}" />
How can we debug this ??
By default maven generated wars will have the following name:
${artifactId}-${version}.war
In you antrun plugin you can reference maven properties ( see http://maven.apache.org/plugins/maven-antrun-plugin/usage.html ).
So if you replace file.name property by a direct maven reference it will just work:
${project.build.directory}/${artifactId}-${version}.${project.packaging}
( above assumes that your ant script is inside the pom.xml and not externalized )
You also can override that in the build section of your pom.xml:
<build>
<finalName>MySuperCoolApplication</finalName>
...
</build>
For general debug output from mvn just use the -X flag
精彩评论