1、更新eclipse的classpath加入新依赖 
 
1、在dependencyManagement里面加入包括版本在内的依赖信息,如:

<dependency>

<groupId>joda-time</groupId>

<artifactId>joda-time</artifactId>

<version>1.6.2</version> 
</dependency> 
 
2、在同级的dependencies节点里面加入该依赖,如:  

<dependency>

<groupId>joda-time</groupId>    
<artifactId>joda-time</artifactId> 
</dependency> 
 
3、使用mvn eclipse:clean删除当前的工程配置文件,并用mvn eclipse:eclipse重新生成。  

4、导入或刷新该eclipse工程。

2、工程配置未使用pom.xml更新 
问题:Project configuration is not up-to-date with pom.xml  
导入maven工程后,出现如下错误: 
Description    Resource    Path    Location    Type 
Project configuration is not up-to-date with pom.xml. Run project configuration update    rdc        line 1    Maven Configuration Problem  
解决办法就是: 
右键项目,【Maven】--》【Update Project Configuration...】即可。。。

3、如何修改默认GBK的资源过滤 
Using platform encoding (GBK actually) to copy filtered resources  
需要指定字符集:

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-resources-plugin</artifactId>

<version>2.2</version>  <configuration>   
<encoding>UTF-8</encoding>

</configuration> 
</plugin> 
  
4、不支持范型的JDK版本问题 
 
maven打包时始终出现TripApplyAction.java:[267,6]-source 1.3中不支持泛型(请使用-source 5或更高版本以启用泛型)Map<String, Object> map = new HashMap<String, Object>();  
解决方法,指定JDK版本:  
在pom.xml文件中加入下一面一段语句来指定所用的版本,尽管在eclipse中配置了正确的“Build Path”:

<build>

<plugins>

<plugin> 
<artifactId>maven-compiler-plugin</artifactId>

<configuration>

<target>1.5</target>

<source>1.5</source>

<encoding>UTF-8</encoding>

</configuration>

</plugin>

</plugins>

</build>  
重新运行mvn clean eclipse:eclipse -Dmaven.test.skip=true,接着mvn package,问题解决。

5、如何在使用命令方式下载依赖的同时下载源码 
 
1. 使用maven命令:mvn dependency:sources 下载依赖包的源代码。  
2. 使用参数: -DdownloadSources=true 下载源代码jar。 -DdownloadJavadocs=true 下载javadoc包。   
6、maven打包,忽略test的参数 
 
mvn -Dmaven.test.failure.ignore=true package mvn -Dmaven.test.skip=true clean package   
7、web.xml which will be ignored 
 
 
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored (webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')   
在使用Maven 编译项目的时候会出现  
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored  
解决方法:  
<plugin> 
<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-war-plugin</artifactId>

<version>2.1.1</version>

<configuration> 
<!-- http://maven.apache.org/plugins/maven-war-plugin/ -->

<packagingExcludes>WEB-INF/web.xml</packagingExcludes>

</configuration>

</plugin>

最新文章

  1. Nginx实现多域名证书HTTPS
  2. linux 下UGet闪退问题
  3. mysql 存储过程 死循环,如何关闭
  4. Windows 10 解决 0x80070021 错误
  5. Less/Sass编译工具,koala使用指南
  6. 重新想象 Windows 8 Store Apps (35) - 通知: Toast 详解
  7. Optimize Managed Code For Multi-Core Machines
  8. Ubuntu 下无法Tab键自动补全功能解决办法
  9. Matlab 高斯分布 均匀分布 以及其他分布 的随机数
  10. EasyUI基础入门之Easyloader(载入器)
  11. oracle spoof用法
  12. Spring Boot Security OAuth2 实现支持JWT令牌的授权服务器
  13. BlockQueue 解析
  14. python jieba库
  15. gops —— Go 程序诊断分析工具
  16. mysql三表查询sql语句
  17. 【noip模拟赛7】上网 线性dp
  18. Java -- Java 类集 -- 目录
  19. 11.23CSS笔记
  20. 使用第三方类、库需要注意的正则类RegexKitLite的使用

热门文章

  1. 1-15-1 RAID磁盘阵列的原理和搭建
  2. iptables详解(7):iptables扩展之udp扩展与icmp扩展
  3. C++:后缀表达式
  4. 小练习:Two Sum
  5. Tree各种遍历实现
  6. C++复习3.C/C++常量的知识
  7. hdu4309
  8. 转载-lvs官方文档04-LVS集群的负载调度
  9. Composer 安装东西遇到github需要token怎么办
  10. WordCount-个人项目2