gpt4 book ai didi

java - Sonatype Nexus 中基于 SVN 谷歌代码的 Maven 存储库的代理

转载 作者:行者123 更新时间:2023-12-04 04:54:09 25 4
gpt4 key购买 nike

我已经为存储库缓存设置了 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 是一种位于基于 google 代码的 maven repo 中的 Artifact 。
 <repository>
<id>htmleasy</id>
<url>http://htmleasy-maven.googlecode.com/svn/trunk/</url>
</repository>

但是我应该怎么做,以便当我引用基于上述 repo 的以下 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 谷歌代码的 Maven 存储库的代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17012280/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com