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

时间:2013-06-09 17:29:26

标签: java maven repository nexus sonatype

我已经为存储库缓存设置了Sonatype Nexus。

com.googlecode.htmleasy没有被maven解决。得到错误

  

未能找到com.googlecode.htmleasy:htmleasy:jar:0.7 in   http://localhost:8081/nexus/content/groups/public被缓存在   本地存储库,在更新之前不会重新尝试解析   nexus的间隔已经过去或强制更新 - > [帮助1]

htmleasy是一个位于基于谷歌代码的maven repo内的工件。

 <repository>
      <id>htmleasy</id>
      <url>http://htmleasy-maven.googlecode.com/svn/trunk/</url>
   </repository>

但是,当我根据上面的回购提及以下工件时,我应该怎么做

<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>

1 个答案:

答案 0 :(得分:3)

Add a new proxy repository并且不要忘记add it to your 'public' repository group

(如果您仍然从maven获得“解决方案将无法重新尝试”错误,请尝试使用'-U'调用maven。)