2013-07-24 39 views
0

如果您在1.7.0 (first not to)2.7.0 (first to contain again)之间的许多版本中查看Ehcache的Maven回购,它们不包含罐子。为什么Maven仓库中的许多版本的Ehcache没有罐子?

我问,因为我想建立依赖于1.7.2旧的项目,我得到的错误:

 
Downloading: http://mvnrepo.initech.net/archiva/repository/snapshots/net/sf/ehcache/ehcache/1.7.2/ehcache-1.7.2.jar 
Downloading: http://repo.maven.apache.org/maven2/net/sf/ehcache/ehcache/1.7.2/ehcache-1.7.2.jar 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 11.871s 
[INFO] Finished at: Wed Jul 24 15:17:44 EDT 2013 
[INFO] Final Memory: 6M/152M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project initech-fintools-business: Could not resolve dependencies for project net.initech:initech-fintools-business:jar:1.0-SNAPSHOT: Could not find artifact net.sf.ehcache:ehcache:jar:1.7.2 in initech_center (http://mvnrepo.initech.net/archiva/repository/Initech_Center) -> [Help 1] 

,我使用Maven 3.1.0我应该不在话下。

回答

3

你可能已经知道,但Maven构件搜索时,您可以使用http://search.maven.org

为什么你找不到任何JAR文件的原因是因为在了Ehcache分成几个文物这些版本。

您可以检查http://search.maven.org/#search%7Cgav%7C2%7Cg%3A%22net.sf.ehcache%22%20AND%20a%3A%22ehcache-core%22

我觉得你要搜索的JAR是here : ehcache-core-1.7.2.jar

所以,你必须在你的POM

<dependency> 
    <groupId>net.sf.ehcache</groupId> 
    <artifactId>ehcache</artifactId> 
    <version>1.7.2</version> 
</dependency> 

<dependency> 
    <groupId>net.sf.ehcache</groupId> 
    <artifactId>ehcache-core</artifactId> 
    <version>1.7.2</version> 
</dependency> 

分裂是取代可能是因为项目越来越智慧而完成h越来越多的东西。为了方便起见,他们可能会在最新版本中重新添加一个JAR。

编辑:

如果同时需要ehcache-coreehcache-terracota,你可以简单地使用:

<dependency> 
    <groupId>net.sf.ehcache</groupId> 
    <artifactId>ehcache</artifactId> 
    <version>1.7.2</version> 
    <type>pom</type> 
</dependency> 
+0

这是有道理的,但后来它为什么“空”的项目都在回购? – ArtB

+0

这些项目不是空的:pom本身就是工件(即它有包装POM,请参阅http://repo.maven.apache.org/maven2/net/sf/ehcache/ehcache/1.7.0/ehcache- 1.7.0.pom)。 POM在这里被用来作为一个工具来同时获得'ehcache-core'和'ehcache-terracota'只有一个依赖。我编辑了我的答案以显示使用情况。 –

+0

谢谢!我以前从来没有见过。 – ArtB

相关问题