Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven-antrun No ant target defined - SKIPPED

i am trying to copy a file in my maven multi-module project via antrun plugin. the file is in root of parent project:

<plugin>                                                           
<groupId>org.apache.maven.plugins</groupId>                    
<artifactId>maven-antrun-plugin</artifactId>                   
<version>1.7</version>                                         
<inherited>false</inherited>                                   
<executions>                                                   
    <execution>                                                
        <inherited>false</inherited>                           
        <id>copy</id>                                          
        <goals>                                                
            <goal>run</goal>                                   
        </goals>                                               
        <configuration>                                        
            <target name="copy and rename file">               
                <copy file="${basedir}/portal-ext.properties" tofile="${liferay.auto.deploy.dir}/../portal-ext.properties" />

            </target>                                          
        </configuration>                                       
    </execution>                                               
</executions>                                                  

i run this via mvn antrun:run the problem is i get "No ant target defined - SKIPPED" on parent and on every module. i need it to run only on parent and thought <inherited>false</inherited> would help but i doesn't. But why "No ant target defined"?

like image 791
dermoritz Avatar asked Sep 25 '13 09:09

dermoritz


People also ask

Can we use Maven and ant together?

You can use the maven-antrun-plugin to invoke the ant build. Then use the build-helper-maven-plugin to attach the jar produced by ant to the project. The attached artifact will be installed/deployed alongside the pom. If you specify your project with packaging pom , Maven will not conflict with the ant build.

What is the use of Maven AntRun plugin?

This plugin provides the ability to run Ant tasks from within Maven. You can even embed your Ant scripts in the POM! It is not the intention of this plugin to provide a means of polluting the POM, so it's encouraged to move all your Ant tasks to a build.


1 Answers

  <plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.7</version>
    <executions>
      <execution>
        <id>ant-execute</id>
        <configuration>
          <target>
          <echo message="plugin classpath:  " />
          </target>
        </configuration>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

command : mvn antrun:run@ant-execute

like image 167
venkat Avatar answered Sep 18 '22 20:09

venkat