【问题标题】:Multiple antrun tasks in mavenmaven中的多个antrun任务
【发布时间】:2022-02-03 00:36:14
【问题描述】:

您将如何在 Maven 构建周期的不同阶段执行 ant 任务?

【问题讨论】:

    标签: maven-2 ant maven-plugin


    【解决方案1】:

    我在构建/插件部分使用了这个

    <plugin>
    
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
    
            <execution>
                <id>clean</id>
                <phase>clean</phase>
                <configuration>
                    <tasks>
                        <echo message = ">>>>>>>>>>>>>>>>>>>>>>>>>>clean"/>
                    </tasks>
                </configuration>
                <goals>
                    <goal>run</goal>
                </goals>
            </execution>
    
            <execution>
                <id>compile</id>
                <phase>compile</phase>
                <configuration>
                    <tasks>
                        <echo message = ">>>>>>>>>>>>>>>>>>>>>>>>>>>>compile"/>
                    </tasks>
                </configuration>
                <goals>
                    <goal>run</goal>
                </goals>
            </execution>
    
            <execution>
                <id>package</id>
                <phase>package</phase>
                <configuration>
                    <tasks>
                        <echo message = ">>>>>>>>>>>>>>>>>>>>>>>>>>>>package"/>
                    </tasks>
                </configuration>
                <goals>
                    <goal>run</goal>
                </goals>
            </execution>
    
        </executions>
    
    </plugin>
    

    【讨论】:

      猜你喜欢
      • 2011-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多