How do I do something after Maven copies webapp resources during a "package"?

How do I do something after Maven copies webapp resources to a military directory inside the target package? I want to do something right after he copies the webapp resources to the target directory of the war, but shortly before he finally archives everything into a WAR file.

+5
source share
3 answers

The reason you have problems is because webapp resources are copied using the war plugin in the same breath as in war. This is not another phase of the life cycle or even two different actions in the same phase. This whole part of the war: the purpose of the war .

. war: exploded , prepare-package, webapp, - , . war:war . ( , , useCache, , , , , .)

+7

, egervari, , .

( YUI Maven Mojo js .)

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                    <configuration>
                        <warName>${warName}</warName>
                        <useCache>true</useCache>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>exploded</goal>
                            </goals>
                      </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>yuicompressor-maven-plugin</artifactId>
                    <version>1.1</version>
                    <executions>
                        <execution>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>compress</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <excludes>
                            <exclude>**/*.min.js</exclude>
                            <exclude>**/*.properties</exclude>
                        </excludes>
                        <nosuffix>true</nosuffix>
                    </configuration>
                </plugin>           
            </plugins>
        </build>
+6

lifecycle

- , . , . (Maven 2.1 )

, JAR.

, - , , pom.

, , , .

-1

All Articles