Related information from hundred | degrees | know | way:
<build> <outputdirectory>src/main/webapp/web-inf/classes</ outputdirectory> <testoutputdirectory>src/main/webapp/web-inf/classes</ testoutputdirectory> <plugins> <plugin> <artifactId> maven-antrun-plugin</artifactid> <executions> <execution> <id>copy-lib-src-webapps</id> <phase>package </phase> &nbsP; <configuration > <tasks> <!-- <delete dir= "Src/main/webapp/web-inf/lib" />--> <copy todir= "${project.web-common.lib-targetpath}" > <fileset dir= "${ Project.commonmodule.lib-source.directory} "> <include name= "*" /> </fileset> </copy> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin > </plugins></build>
Purpose: Copies the packaged jar-generated jars to the specified path
Obstruction: Command MVN package, only to generate the jar packages, if you simply copy files using the resources method, it is not possible to copy a thing that does not exist to a certain place at package time.
Workaround: Add Antrun plugin to change the order of packaging and copying, making it possible to make a copy after packaging.
PS: The path specified in the properties in Project, the module of project is understood to be used.
Maven Combat (ix)--Packaging tips
MAVEN packs the generated jar to the specified path at the same time