当你部署了一个私有的Maven Repo,然后release/snapshots里库被更新了,就有可能遇到标题上的错误。
网上有一种解决办法,就是修改setting.xml里的updatePolicy设置,比如:
1 2 3 4 5 6 7 8 9 10 11 12 |
<repository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> |
把updatePolicy改成always, 就没有这个问题了。
还有一种办法就是在命令行上加上-U的选项,有一样的效果。下面有一些说明。
- -U,–update-snapshots Forces a check for updated releases and snapshots on remote repositories
- -up,–update-plugins Ineffective, only kept for backward compatibility