【发布时间】:2009-12-28 14:15:57
【问题描述】:
问题有点愚蠢,但我找不到任何 spring3.0-with-dependencies.jar。是否假设我应该自己找到所有必要的依赖项?
在这种情况下,我可以使用 spring 2.5 的依赖项吗? UPD:答案是否定的,我不能。那么,依赖在哪里呢??
【问题讨论】:
问题有点愚蠢,但我找不到任何 spring3.0-with-dependencies.jar。是否假设我应该自己找到所有必要的依赖项?
在这种情况下,我可以使用 spring 2.5 的依赖项吗? UPD:答案是否定的,我不能。那么,依赖在哪里呢??
【问题讨论】:
我猜他们不会再释放它们了。如果您使用 maven 或 ivy,您可以自动拥有依赖项。您只需要像这样在 pom.xml 中定义依赖项:
<pom>
...
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.0.0.RELEASE</version>
</dependency>
</dependencies>
...
</pom>
Maven 会传递所有的依赖。
【讨论】:
如果您使用的是 Maven,则可以从 central 存储库获取 Spring 3.0 jars(及其传递依赖项)。只需将其添加到您的pom.xml:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.0.RELEASE</version>
</dependency>
有关更多详细信息,更多工件,请查看Obtaining Spring 3 Artifacts with Maven(如果不需要,请不要使用 EBR,否则我保证会做噩梦)。
【讨论】:
通常 readme.txt 文件列出了每个模块的依赖项。有了它,您通常可以从 maven 存储库中轻松获取它们……或者更好的是,使用 maven (http://maven.apache.org)。
【讨论】: