Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
<plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  <executions>
    <execution>
      <phase>install</phase>
      <configuration>
        <tasks>
          <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.plugin.classpath"/>

            <delete file="${my.jboss.server}/deploy/${build.finalName}.war"/>
          <delete dir="${my.jboss.server}/deploy/${build.finalName}.war"/>

          <if>
            <isset property="unpacked"/>
            <then>
              <mkdir dir="${my.jboss.server}/deploy/${build.finalName}.war"/>
              <unzip src="${project.build.directory}/${build.finalName}.war"
                      dest="${wsm.jboss.server}/deploy/${build.finalName}.war"/>
            </then>
            <else>
              <copy todir="${my.jboss.server}/deploy">
                <fileset dir="${project.build.directory}" includes="${build.finalName}.war"/>
              </copy>
            </else>
          </if>
       </tasks>

      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
     </execution>
   </executions>
   <dependencies>
   <dependency>
     <groupId>ant-contrib</groupId>
     <artifactId>ant-contrib</artifactId>
     <version>1.0b3</version>
     <exclusions>
       <exclusion>
         <groupId>ant</groupId>
         <artifactId>ant</artifactId>
       </exclusion>
     </exclusions>
   </dependency>
   <dependency>
     <groupId>ant</groupId>
     <artifactId>ant-nodeps</artifactId>
     <version>1.6.5</version>
   </dependency>
  </dependencies>
</plugin>

...

Using the Maven Antrun Plugin in multiple projects in the Reactor

In Maven 2.0.x, there is a significant bug that can lead to very perplexing failures with the antrun plugin. There are two conditions that you have to meet to get into this problem.

1) You have to use the plugin in two projects that are loaded into the reactor via <modules/> .
2) You have to require additional plugin dependencies on the plugin.

In Maven 2.0.x, the dependencies of the first project into the reactor win, and all the others are entirely ignored.

...