12
我想用nexus創建公司本地的maven知識庫。存儲庫不應該從公共互聯網下載任何東西,所有需要的東西都會被添加到回購中。開發人員的本地maven instanses應該從公司網站下載所需的庫和工具。我已設法在settings.xml中使用鏡子這樣做:如何只使用公司本地nexus知識庫
<mirror>
<id>company-repository</id>
<name>Company releases repository</name>
<url>http://nexus.company.com/nexus/content/repositories/releases</url>
<mirrorOf>*</mirrorOf>
</mirror>
問題該解決方案是,我只能指向版本庫,我想包括第三方和快照庫搜索以及。有沒有人知道應該怎麼做?鏡像標籤只有一個網址。
我也試圖與定義這樣的默認配置文件:
<profile>
<id>defaultProfile</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>company-thirdparty-repo</id>
<url>http://nexus.company.com//nexus/content/repositories/thirdparty</url>
<releases>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>company-releases-repo</id>
<url>http://nexus.company.com/nexus/content/repositories/releases</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://nexus.company.com/nexus/content/repositories/central</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
問題與解決辦法是,如果Maven的不找到這些倉庫的東西它仍然下載它從repo.maven.apache.org。我會感謝任何幫助。謝謝!
在標籤你需要說「*」,否則只有中央將被鏡像(看看這裏:http://www.sonatype.com/books/nexus-book/reference/maven-sect-single-group.html )。 –
khmarbaise
@khmarbaise這就是我想要做的:在nexus回購組中鏡像中心,並在其上添加額外的回購 –
爲了解決這個問題,它應該在Nexus中配置,而不是在settings.xml中配置。 – khmarbaise