我有一个在 Eclipse 中嵌入的 tomcat 上运行的 Web 应用程序。 它工作正常,但是当我第二天尝试时 - 它需要干净安装/构建/刷新所有依赖项。 如果我不这样做 - Eclipse 将不会复制一些依赖项。每天我都为此浪费很多时间。是否存在可以在 Eclipse 中工作而无需每天进行多次重建/刷新、更新依赖项/项目配置等的方式?或者至少 - 快照超时是多少? 谢谢。
最佳答案
我不确定我是否理解您的问题,但如果您不希望 SNAPSHOT 依赖项更新得太频繁,您可以使用 settings.xml
中的 updatePolicy
参数进行适当配置。例如never
永远不会更新快照。
来自 settings reference ,
updatePolicy: This element specifies how often updates should attempt to occur. Maven will compare the local POM's timestamp (stored in a repository's maven-metadata file) to the remote. The choices are: always, daily (default), interval:X (where X is an integer in minutes) or never.
<repositories>
<repository>
<id>my-snapshots</id>
<name>Snapshot Repository</name>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>http://url/to/my/snapshot/repository</url>
</repository>
</repositories>
关于java - eclipse中maven快照的超时时间是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10426041/