MAVEN的插件地址:
http://maven.apache.org/plugins/#

包括官方的插件和一些重要的第三方插件


1. 官方

1. compiler

作用

指定项目使用的java编译器,地址

这个插件一般都会显示声明,因为官网上说了,“默认JDK1.5,如果要指定请设置XXX”,现在没人用1.5吧,所以都会用到

常见问题

  1. Eclipse下的maven项目编译问题:

    1. Eclipse中的项目默认使用Preferences/项目Properties中指定的编译器级别来编译项目。然后它会在生成的.classpath文件中描述出对应编译器级别的jdk/jre版本。

    2. 但Maven使用自己的编译器(就是这个插件)且默认JDK1.5编译级别,所以必须重新指定compiler插件编译级别。之后,在使用compile/eclipse mvn插件update方法时,项目会被指定版本编译器重新编译,并覆盖.classpath中的jdk/jre版本。

例配

<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.3</version><configuration><source>1.7</source><target>1.7</target></configuration>
</plugin>

2. war

作用

打war包插件,可以指定名字和排除与包括哪些文件等等。地址

当在pom.xml中第二级目录中指定了

<packaging>war</packaging>

时,此插件就会在使用Maven命令“package”打war包时发挥作用。

例配

<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><version>2.6</version><configuration><warName>${war.name}</warName><warSourceExcludes>WEB-INF/log/**</warSourceExcludes></configuration>
</plugin>

2. 第三方

1. tomcat

作用

添加一个servlet容器 - tomcat

不知道为什么,tomcat项目官方开发小组只为其Maven插件开发到2013年就中断了,只到了2.2version和tomcat7

例配

<plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><version>2.2</version><configuration><port>8080</port><path>/xxx</path><uriEncoding>UTF-8</uriEncoding></configuration>
</plugin>

2. org.mybatis.generator

作用

mybatis自动生成代码插件

例配

<plugin><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-maven-plugin</artifactId><version>1.3.2</version><configuration><configurationFile>src/main/resources/mybatis-generator.xml</configurationFile><verbose>true</verbose><overwrite>true</overwrite></configuration>
</plugin>

Maven - Plugins相关推荐

  1. 解决Failed to execute goal org.apache.maven.plugins

    1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3 . 2 :compile  ...

  2. 报错: eclipse加载maven工程提示pom.xml无法解析org.apache.maven.plugins:maven-resources-plugin:2.3.2...

    错误信息出现在pom头的project标签,project标签内容是 <project xmlns="http://maven.apache.org/POM/4.0.0" x ...

  3. 针对Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1的解决方案

    2019独角兽企业重金招聘Python工程师标准>>> 背景:本项目使用JDK1.8 编译maven工程的时候出现如下错误: Failed to execute goal org.a ...

  4. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile)

    完整的错误信息: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile ( ...

  5. 针对maven install 报错:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1 解决方案...

    项目运行环境:jdk1.8+tomcat8 maven install 时报错:Failed to execute goal org.apache.maven.plugins:maven-compil ...

  6. Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test)

    这是因为测试代码时遇到错误,它会停止编译.只需要在pom.xml的<project>里添加以下配置,使得测试出错不影响项目的编译.<build> <plugins> ...

  7. 解决:Cannot resolve plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2问题

    出现Cannot resolve plugin org.apache.maven.plugins这类的问题原因基本都是一样的,都是导入本地仓库时出错,出错的原因可能是版本原因,也有其他原因. 解决办法 ...

  8. IDEA报错:Cannot resolve plugin org.apache.maven.plugins:*

    导入项目时可能因为网络等因素造成maven的一些问题. 使用maven-deploy插件多年来遇到了这个问题,即使我没有在我的POM中直接包含插件,也出现了错误. 作为一个解决方案我不得不强制将插件包 ...

  9. 【maven install报错】Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war

    maven install报错如下: [INFO] Scanning for projects... [INFO] Downloading: http://xxx.xx.xx.x:xxxx/nexus ...

  10. 【maven install报错】Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile

    maven install之后报的错误如下: [INFO] Scanning for projects... [INFO] Downloading: http://xxx.xxx.xxx.xxx:xx ...

最新文章

  1. Spring是怎样诞生的?
  2. Azure 部署 Asp.NET Core Web App
  3. java 管理系统 注释_员工管理系统--带注释--oracle系统--java项目
  4. 怎么样把设备管理器弄到计算机处,电脑设备管理器要连接上蓝牙的方法
  5. 29 - Excel 图表与数据分析
  6. setoolkit制作简单钓鱼网站
  7. 看书学习感悟系列(二)
  8. PS图片上传图片 同时生成微缩图
  9. [源码分析]go-graceful如何shutdown gracefully
  10. 第89章、系统服务之SMS服务(从零开始学Android)
  11. javascript--贪食蛇(完整版-逻辑思路)
  12. csr867x入门之iis使用(八)
  13. 0x55——C#中的Lambda Expression
  14. GET提交中%5B与%5D代表什么意思?
  15. R语言使用贝叶斯层次模型进行空间数据分析
  16. Green Sleeves
  17. 电脑什么也没打开,但内存占用很多
  18. PS Vita停产 索尼为何不再重视掌机市场?
  19. 亲测!超纯净的软件管家
  20. 打算去10月国庆去菲律宾,先来学点和菲律宾有关的英语

热门文章

  1. 使用国内的WSUS服务
  2. antvue table 表格实现 首行搜索
  3. 关闭Windows Server的IE增强安全配置(ESC)
  4. 2.4G还是5G?教你如何正确选择路由器
  5. 哈工大 csapp大作业 120L021917
  6. 无法确定本地文件类型_如何从文件内容确定文件类型
  7. C#中 object类型
  8. 32位微型计算机原理接口技术及其应用,32位微型计算机原理·接口技术及其应用...
  9. cocos做飞机大战笔记【添加游戏音效】
  10. java中将word流化,Microsoft Word - 2015最新java面试题.doc