Maven-antrun 未定义 ant 目标 - 已跳过

标签 maven maven-antrun-plugin

我正在尝试通过 antrun 插件复制我的 Maven 多模块项目中的文件。该文件位于父项目的根目录中:

<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>                                                  

我通过mvn antrun:run运行这个问题是我在父级和每个模块上得到“未定义 ant 目标 - 已跳过”。我需要它只在父级上运行并认为 <inherited>false</inherited>会有所帮助,但我没有。但为什么“没有定义 Ant 目标”?

最佳答案

  <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>

命令 : mvn antrun:run@ant-execute

关于Maven-antrun 未定义 ant 目标 - 已跳过,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19001432/

相关文章:

java - RESTEASY003210 : Could not find resource for full path : Tomcat

java - Maven编译器,只编译带注释的类

maven - jenkinsfile - 如何访问我的 pom.xml 中的自定义属性?

java - 使用 IDE 运行 Spring-boot 的 main

maven - 更改 Jenkins 作业工作区

maven-antrun-plugin 如果满足两个可能条件中的任何一个,则跳过目标

java - 无法在 Maven 设置中引用 Chromedriver.exe 在 Selenium Grid 中运行测试

ant - Maven Antrun和依赖项

java - 如何在testCompile和test阶段之间(Surefire执行之前)执行Maven的antrun?

Maven:在构建过程中安装jar文件