我是 Maven 新手,正在尝试建立我的第一个POM
s。我的应用程序将使用 EhCache 进行缓存。前往 Maven Central Repo(链接here http://mvnrepository.com/artifact/net.sf.ehcache/ehcache/2.5.0)我复制并粘贴了<dependency>
标记并将其复制到我的pom.xml
像这样:
...many dependencies above this point
<dependency>
<scope>compile</scope>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.0.1.Final</version>
</dependency>
<dependency>
<scope>compile</scope>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<scope>compile</scope>
<groupId>jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>3.5.3</version>
</dependency>
...many dependencies below this point
当我保存更改时,Eclipse 会构建工作区并在打开时给出错误<dependency>
EhCache 2.5 的标签:
缺少工件 net.sf.ehcache:ehcache:jar:2.5.0
所以我认为 v.2.5.0 可能有问题,并重复了同样的事情2.4.7
(最后2.4.x
之前释放2.5.0
)。同样的交易。
由于我对 Maven 很陌生,我什至不知道从哪里开始寻找。我试过Project >> Clean
甚至重新启动 Eclipse 以查看这是否只是典型的 Eclipse“怪癖”。没有。
我在想:
- EhCache 是否会将错误的 JAR 发布到 Maven 存储库?
- Maven Repo 可能有问题吗?
- 这可能是由于我的其他配置错误造成的
pom.xml
?
- 这可能是一个“JAR hell“我的依赖图上某个地方有冲突的问题?
SO 将如何开始解决这个问题?提前致谢!
通常参考更安全搜索.maven.org http://search.maven.org。从那里的依赖:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.5.0</version>
<type>pom</type>
</dependency>
心灵类型pom。从模块的 pom 中:
这是一个 pom 工件,用于拉入 ehcache-core 和 ehcache-terracotta
用于聚类。确保在依赖项中将“type”设置为“pom”。
显然,当有人不需要兵马俑时,ehcache-core将像其他答案所述那样完美地工作。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)