Pom in the parent
<build> <pluginManagement> <plugins> <plugin> <groupid>org.apache.maven. Plugins</groupid> <artifactId>maven-source-plugin</artifactId> <version>2.1 .2</version> <executions> <execution> <phase>package<
/phase> <goals><goal>jar-no-fork</goal></goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plu Gins</groupid> <artifactId>maven-rar-plugin</artifactId> <version>2.2</vers
ion> <executions> <execution> <phase>package</phase>
<goals><goal>rar</goal></goals> </execution> </executions>
</plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactid>sql-maven-plugin<
;/artifactid> <version>1.5</version> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> &L t;version>5.1.18</version> </dependency> </dependencies> <configura
Tion> <driver>${mysql.driver}</driver> <url>${mysql.url}</url>
<username>${mysql.username}</username> <password>${mysql.password}</password>
<sqlCommand> CREATE DATABASE IF not EXISTS maven_test </sqlCommand> </configuration> <executions> <execution> <phase& Gt;package</phase>
<goals> <goal>execute</goal> </goals> </execut ion> </executions> </plugin> </plugins> </pluginManagement> </build& Gt
Called in the module:
<build> <finalName>user-web</finalName> <plugins> <plugin> <gro Upid>org.apache.maven.plugins</groupid> <artifactId>maven-war-plugin</artifactId> & Lt;version>2.2</version> <configuration> <warName>hello</warName> &
lt;/configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <configuration> <scanintervalseconds>10&
lt;/scanintervalseconds> <webApp> <contextPath>/kk</contextPath> </webApp>
<connectors> <connector implementation= "Org.eclipse.jetty.server.nio.SelectChannelConnector" > <port>8787</port> <maxIdleTime>60000</maxIdleTime> </connector&
Gt </connectors> </configuration> </plugin> </plugins> </build>
Enquiry Address: http://maven.apache.org/plugins/index.html
Common plugins: http://blog.163.com/lizhe_163/blog/static/6733560820119584353752/
Plug-ins used in our project; The first is to prevent JDK version problems, and the second is a question about test testing
<build>
<plugins>
<plugin>
<groupid>org.apache.maven.plugins</groupid >
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source >1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId> maven-surefire-plugin</artifactid>
<configuration>
<skip>true</skip>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
<defaultGoal>package</defaultGoal>
</build>