Maven常用插件
2013-03-20 15:51
260 查看
Maven常用插件
Maven常用插件1) 通用
Xml代码
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<debug>true</debug>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.9</version>
<configuration>
<skipTests>true</skipTests>
<testFailureIgnore>flase</testFailureIgnore>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<configuration>
<outputDirectory>dependencies</outputDirectory>
</configuration>
</plugin>
2) 打包
Xml代码
<!-- mvn war:war -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.2</version>
<configuration>
<packagingExcludes>WEB-INF/web.xml</packagingExcludes>
<webXml>WebContent/WEB-INF/web.xml</webXml>
<outputDirectory>target</outputDirectory>
<warName>client</warName>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
<!-- mvn jar:jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<excludes>
<exclude>**/impl/*.class</exclude>
</excludes>
</configuration>
</plugin>
<!-- mvn source:jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<configuration>
<excludes>
<exclude>**/impl/*.java</exclude>
</excludes>
</configuration>
</plugin>
<!-- mvn ejb:ejb -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
3) 部署
Xml代码
<!-- mvn package jboss:hard-undeploy jboss:hard-deploy -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jboss-maven-plugin</artifactId>
<version>1.5.0</version>
<configuration>
<jbossHome>D:\apps\jboss-5.1.0.GA</jbossHome>
<serverName>default</serverName>
<fileName>target/${project.artifactId}-${project.version}.jar</fileName>
</configuration>
<executions>
<execution>
<id>redeploy</id>
<phase>install</phase>
<goals>
<goal>hard-undeploy</goal>
<goal>hard-deploy</goal>
</goals>
</execution>
<execution>
<id>undeploy</id>
<phase>clean</phase>
<goals>
<goal>hard-undeploy</goal>
</goals>
</execution>
</executions>
</plugin>
4) Jetty
Xml代码
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.26</version>
<configuration>
<scanIntervalSeconds>20</scanIntervalSeconds>
<stopKey>foo</stopKey>
<stopPort>9999</stopPort>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
<connector implementation="org.mortbay.jetty.security.SslSocketConnector">
<port>8443</port>
<maxIdleTime>60000</maxIdleTime>
<keystore>C:/Documents and Settings/zhuoying/.keystore</keystore>
<password>yingzhor@163.com</password>
<keyPassword>yingzhor@163.com</keyPassword>
</connector>
</connectors>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-sslengine</artifactId>
<version>6.1.26</version>
</dependency>
</dependencies>
</plugin>
相关文章推荐
- maven 常用插件 jdk版本指定,自定义jar包生成源码文件
- maven常用插件实用技巧
- maven 常用插件3
- 121 项目 008 笔记向 maven-study 常用插件
- 常用maven插件总结-joed
- 常用Maven插件介绍(下)
- maven常用插件解析
- Maven常用插件介绍
- 常用Maven插件介绍
- maven常用插件: 打包源码 / 跳过测试 / 单独打包依赖项
- Maven学习笔记(二)——常用插件配置详解
- Maven常用插件配置
- Maven实战(七,八)——常用Maven插件介绍
- Maven实战(八)——常用Maven插件介绍(下)
- Maven常用插件列表
- Maven常用插件使用说明之deploy
- 常用Maven插件介绍(上)
- 学习笔记——Maven实战(八)常用Maven插件介绍(下)
- maven 常用插件
- Maven常用插件介绍 以及apache索引---perfect