有用插件:
Maven Release Plugin 版本发布;
cargo-maven2-plugin 自动化部署;
jetty-maven-plugin web测试;
maven-gpg-plugin, GPG:http://www.gnupg.org/download/ 给maven构件加密 hkp://pgp.mit.edu 美国麻省理工大学公钥服务器
maven-surefire-plugin: 单元测试,集成测试
maven-site-plugin:生成站点 //mvn site
maven-javadoc-plugin
maven-jxr-plugin:在生成站点时配置该插件,会以Web页面的形式将Java源代码展现出来
maven-checkstyle-plugin
maven-pmd-plugin:分析Java源代码,查找代码中的问题
maven-changelog-plugin
cobertura-maven-plugin
常用命令:
mvn -v
mvn help:system
mvn clean compile
mvn clean package
mvn clean test
mvn clean deploy //部署到版本仓库
mvn clean install //使其他项目使用这个jar,会安装到maven本地仓库中
mvn archetype:generate //创建项目架构
mvn dependency:list //查看已解析依赖
mvn dependency:tree
mvn dependency:analyze
mvn install -Dmaven.test.skip=true// -D 参数的使用,这里是跳过test阶段
-am, –also-make :同时构建所列模块的依赖模块
-amd -also-make-dependents 同时构建依赖于所列模块的模块 mvn clean install -pl account-parent -amd -rf account-email
-pl, –projects <arg> 构建指定的模块,模块间用逗号分隔 mvn clean install -pl account-email,account-persist
-rf -resume-from <arg> 从指定的模块回复反应堆 mvn clean install -rf account-email
mvn help:active-profiles :查看当前激活的profiles
mvn help:all-profiles : 查看所有profiles
mvn help:effective -pom 查看完整的pom信息
下面是一些插件的完整配置
<plugins>
<!-- war -->
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<configuration>
</configuration>
</plugin>
<!-- compiler -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- eclipse -->
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.4</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<wtpversion>1.5</wtpversion>
</configuration>
</plugin>
<!-- jetty run -->
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.21</version>
<configuration>
<contextPath>/</contextPath>
<scanIntervalSeconds>3</scanIntervalSeconds>
<scanTargetPatterns>
<scanTargetPattern>
<directory>src/main/webapp/WEB-INF</directory>
<excludes>
<exclude>**/*.jsp</exclude>
<exclude>**/*.js</exclude>
<exclude>**/*.css</exclude>
</excludes>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</scanTargetPattern>
<scanTargetPattern>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</scanTargetPattern>
<scanTargetPattern>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
<include>**/*.xml</include>
</includes>
</scanTargetPattern>
</scanTargetPatterns>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>9999</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
<!-- javadoc-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- 打包插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.iwgame.fetche.log.LogFetcher</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
<!-- assembly -->
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<!-- 这里就是mainclass 配置 -->
<mainClass>auto.lazy.test.LazyT</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
分享到:
相关推荐
该插件允许用户整合项目的输出,包括依赖,模块,网站文档和其他文档到一个单独的文档,即可用定制化打包。 创建的文档格式包括:zip, tar, tar.gz(tgz), gar.bz2(tbgz2), jar, dir,war 等等。四种预定义的描述器可用:...
主要介绍了Maven 常用插件的详细整理的相关资料,这里整理了maven的常用插件需要的朋友可以看下,需要的朋友可以参考下
包含了企业常用SVN插件,Maven插件等
1.1. 参考配置 1.3. 版本范围规则 1.4. 扩展插件 2.1. 项目满足条件 2.2. 命令行运行 2.2.1. 更新全部子项目的版本号 2.2.2.
apache-maven-3.2.1 maven插件 免费下载 亲测可用 实用
maven安装详细步骤,包括以下常用错误的解释。同时提供eclipse下安装maven插件的方法
maven常用插件以及使用,常见maven的错误解决
[maven] 常用插件解析.docx
maven的插件开发文档,比较实用,你可以通过例子快速入门
Maven3实战笔记05——仓库依赖解析与插件解析。
Maven可以简化项目的构建和依赖管理,并提供...Maven自带了许多常用的插件,如编译、测试、打包插件等。 5、文档生成:Maven可以使用插件来生成项目的文档,如JavaDoc文档、站点文档等。 6、多模块支持:Maven支持多
NULL 博文链接:https://lyb520320.iteye.com/blog/972566
实用的插件,用于检查未使用的直接和已使用的间接(传递)依赖项。 用法 通过命令行临时执行 要通过命令行执行此插件的最新版本,请将其更改为maven项目。 “检查-延后” Maven目标 mvn ...
将下载的压缩包解压到开发工具常用的目录,例如D:\developer\apache-maven-3.9.1-bin。 配置系统环境变量。在Windows系统中,进入“高级系统设置”,点击“环境变量”。在“系统变量”中编辑Path,添加Maven的bin...
将下载的压缩包解压到开发工具常用的目录,例如D:\developer\apache-maven-3.9.1-bin。 配置系统环境变量。在Windows系统中,进入“高级系统设置”,点击“环境变量”。在“系统变量”中编辑Path,添加Maven的bin...
包含常用svn maven exp openExplorer adt egit 插件包,使用link方式安装比较好管理。
将下载的压缩包解压到开发工具常用的目录,例如D:\developer\apache-maven-3.9.1-bin。 配置系统环境变量。在Windows系统中,进入“高级系统设置”,点击“环境变量”。在“系统变量”中编辑Path,添加Maven的bin...
将下载的压缩包解压到开发工具常用的目录,例如D:\developer\apache-maven-3.9.1-bin。 配置系统环境变量。在Windows系统中,进入“高级系统设置”,点击“环境变量”。在“系统变量”中编辑Path,添加Maven的bin...
将下载的压缩包解压到开发工具常用的目录,例如D:\developer\apache-maven-3.9.1-bin。 配置系统环境变量。在Windows系统中,进入“高级系统设置”,点击“环境变量”。在“系统变量”中编辑Path,添加Maven的bin...
日常开发中Maven已经逐步普及,但大部分开发人员还不熟悉...本案例主要介绍在eclipse下Maven插件的使用指导,并列举出当前使用过程中发现的一些问题。目的是让开发人员能够正确使用Maven,对Maven的操作有一致的认识。