How to call the ant task to process webapp files after "copying Webapp resources" and before the steps "build war" in the package phase?

I am switching from ant to maven. However, I have a custom build function for the web resources of the process, which I do not want to adapt to maven yet (the cost is very high), so I use the ant run plugin.

I want to process some resource files that invoke the ant task. This is necessary for occurring after the step of "copying web resources" and before the steps of "building wars" in a phase package.

When I run my ant task, when the phase is a "package"

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                    <configuration>
                        <tasks>
                            <ant antfile="${basedir}/build-resources.xml">
                                 <property name="runtime-classpath" refid="maven.runtime.classpath"/>
                            </ant>
                        </tasks>
                    </configuration>
                </execution>
            </executions>
        </plugin>   

mychanges target/myapp-webapp. , myapp-webapp.war ant, .

?

+3
1

maven-lifecycle! ant -task - process-resources, .

, :

...
<executions>
 <execution>
  <id>my-ant-processed-files</id>
  <phase>prepare-package</phase>
  ...

?

+3

All Articles