我已经设置了 Sonatype Nexus 来进行存储库缓存。
com.googlecode.htmleasy 未被 maven 解析。出现错误
Failure to find com.googlecode.htmleasy:htmleasy:jar:0.7 in
http://localhost:8081/nexus/content/groups/public
was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]
htmleasy 是一个 Artifact ,位于基于 google 代码的 Maven 存储库中。
<repository>
<id>htmleasy</id>
<url>http://htmleasy-maven.googlecode.com/svn/trunk/</url>
</repository>
但是当我根据上述存储库引用以下 Artifact 时,我应该做什么
<dependency>
<groupId>com.googlecode.htmleasy</groupId>
<artifactId>htmleasy</artifactId>
<version>0.7</version>
</dependency>
被我的 maven 解决了吗?
我的 Maven 设置 xml 如下所示,
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<proxies></proxies>
<servers></servers>
<pluginGroups></pluginGroups>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
最佳答案
Add a new proxy repository并且不要忘记 add it to your 'public' repository group 。
(如果您仍然收到来自 Maven 的“解决方案将不会重新尝试”错误,请尝试使用“-U”调用 Maven。)
关于java - Sonatype Nexus 中基于代理 SVN Google Code 的 maven 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17012280/