Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For the war path, you can use built in Maven properties:</p> <pre><code>${project.build.directory}/${project.build.finalName}.${project.packaging} </code></pre> <p>You want to set the deployment path as a custom Maven property. There are a few ways to do this. One is setting it directly in the pom, like this:</p> <pre><code>&lt;properties&gt; &lt;deploy.path&gt;C:/Softwares/apache-tomcat-6.0.33/webapps/Test.war&lt;/deploy.path&gt; &lt;/properties&gt; </code></pre> <p>However, this is still hard coding the path in the pom, just in a variable. </p> <p>Another way is to use the <a href="http://mojo.codehaus.org/properties-maven-plugin/plugin-info.html" rel="nofollow">properties-maven-plugin</a> to read in a properties file. This keeps user specific settings out of the pom, and you can keep your properties file out of source control. However, this is not the preferred Maven way of doing things, and this plugin may no longer be supported in future versions.</p> <p>The Maven way to do this is to store your deploy path in your ~/.m2/settings.xml file. This property would go in a profile, which can be active by default. See <a href="http://maven.apache.org/examples/injecting-properties-via-settings.html" rel="nofollow">this page</a> for an explanation.</p> <p>Once you have your deploy.path variable set, change your copy statement to look like this:</p> <pre><code>&lt;copy file="${project.build.directory}/${project.build.finalName}.${project.packaging}" tofile="${deploy.path}" /&gt; </code></pre> <p>Edit:</p> <p>On a minimal example project, the following properties are all set for me:</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt; &lt;version&gt;1.7&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;compile&lt;/id&gt; &lt;phase&gt;compile&lt;/phase&gt; &lt;configuration&gt; &lt;target&gt; &lt;echo message="project.build.directory: ${project.build.directory}"/&gt; &lt;echo message="project.build.finalName: ${project.build.finalName}"/&gt; &lt;echo message="project.packaging: ${project.packaging}"/&gt; &lt;/target&gt; &lt;/configuration&gt; &lt;goals&gt; &lt;goal&gt;run&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; </code></pre> <p>If those properties aren't set for you, can you post your pom.xml?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload