【发布时间】:2014-03-16 14:13:00
【问题描述】:
我使用过 Sonatype Nexus 仓库管理,我的需求如下:
- 首先应该显示我的自定义 Nexus 存储库,maven 应该首先检查那里
- 如果某些 jars 不存在,那么它应该转到 Maven Central
- 对于那些甚至不在 Maven Central 中的 jar,比如 (Eigenbase-XOM),它应该转到 PentaHo
但是事情对我不起作用,显示 EigenBase XOM is missing artifact 错误,因为它没有被下载
如果有人可以提供帮助,那将是一个很大的帮助。请让我知道我哪里错了?
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<mirrors>
<mirror>
<id>MyRepo</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:port/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>MyRepo</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>pentaho-releases</id>
<url>http://repository.pentaho.org/artifactory/repo/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
</pluginRepository>
</pluginRepositories>
</profile>
<activeProfiles>
<activeProfile>MyRepo</activeProfile>
</activeProfiles>
</settings>
【问题讨论】:
-
最简单的解决方案是在 Nexus 中配置一个存储库组。然后配置 Maven 客户端使用它。