1

我有在 Eclipse 中嵌入的 tomcat 上运行的 Web 应用程序。它工作正常,但是当我第二天尝试时 - 它需要全新安装/构建/刷新所有依赖项。如果我不这样做 - eclipse 不会复制一些依赖项。我每天为此浪费很多时间。是否存在可以在 Eclipse 中工作的方式,而无需每天进行多次重建/刷新、更新依赖项/项目配置等?或者至少 - 什么快照超时?谢谢。

4

1 回答 1

1

I am not sure I understand your question, but if you do not want your SNAPSHOT dependencies to be updated too frequently, you can configure this using updatePolicy parameter in settings.xml suitably. For instance never will never update the snapshots.

From the 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>
于 2012-05-03T06:54:05.647 回答