java - Sonatype Nexus 中基于代理 SVN Google Code 的 maven 存储库

标签 java maven repository nexus sonatype

我已经设置了 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/

相关文章:

java - Maven编译报错try-with-resources

java - string.replaceAll java 不适用于环视正则表达式?

java - 如何在两个或多个 Servlet 之间共享变量或对象?

java - 交易ID创建

java - Spring Boot 测试在 Eclipse 中失败,但在命令行上通过(由于 PropertyResolver 为 Null,无法加载 ApplicationContext)

maven - 将 Selen 测试与构建过程分开

ubuntu - 强制我的自定义 debian 包解决来自特定存储库的 R 依赖项

git - 从命令行重命名 Github 存储库

git - 在 GIT 存储库中测试虚拟机

java - ElementListSelectionDialog 没有元素