1、pom.xml文件中添加新的库

在中央仓库找不到你想要的jar的时候,可以在pom.xml中添加附加的库,语法如下

    <repositories>
<repository>
<id>java.net</id>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
<releases><enabled>true</enabled><updatePolicy>always</updatePolicy></releases>
<snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</repository>

2、我们在maven install的时候,有些时候其实并不需要顺带执行test动作,这是后可以修改pom文件跳过test步骤

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.13</version> <configuration>
<includes>
<include>**/*Tests.java</include>
</includes>
<skipTests>true</skipTests><!-- 自动跳过test -->
</configuration>
</plugin>

3、Failure to transfer xmlpull:xmlpull:jar:1.1.3.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact xmlpull:xmlpull:jar:1.1.3.1 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled.

出现类似这样的报错,但是maven install 有不管用,可知是本地仓库的缓存(cached)造成,到本地中央仓库的对应目录下把 xxx.lastUpdated文件全部删掉,重新运行maven即可。

或者在用maven时加 -U参数,就可以忽略xxx.lastUpdated.

最新文章

  1. 2DToolkit官方文档中文版打地鼠教程(三):Sprite Collections 精灵集合
  2. mysql max_allowed_packet
  3. 基于 IdentityServer3 实现 OAuth 2.0 授权服务【密码模式(Resource Owner Password Credentials)】
  4. JS调用Delphi编写的OCX控件
  5. jQuery select 操作全集
  6. CSS自学笔记(11):CSS3背景和边框
  7. Android SwipeRefreshLayout
  8. Django小例子 – 模型数据的模板呈现
  9. CocoaPods 安装及使用
  10. vue 源代码创建tabs
  11. PE知识复习之PE合并节
  12. spark-RDD源码分析
  13. Linux内存管理 (3)内核内存的布局图
  14. Arrays类
  15. 椭圆曲线密码学ECC
  16. 12LaTeX学习系列之---LaTex的图片插入
  17. Vladik and Entertaining Flags CodeForces - 811E (并查集,线段树)
  18. Centos替换默认源
  19. MySQL的left on 【zt】
  20. Understanding Undefined Behavior

热门文章

  1. 解决PowerDesigner 反向工程没有注释(备注)
  2. android147 360 程序锁
  3. NGUI panel使用soft clip时,屏幕缩放后无法正常工作的问题解决
  4. C语言二维数组作为函数的参数
  5. 网络IPC:套接字之建立连接
  6. Learning Theory
  7. Helpers\Database
  8. eclipse 如何使用svn
  9. aptana中删除空行
  10. Objective-C ,ios,iphone开发基础:NSDictionary(字典) 和 NSMutableDictionary