即時通訊使用Maven 3.0.4和Nexus 2.0.6。我已經設置了我的settings.xml作爲使用單個存儲庫的Nexus指令。 當maven試圖運行maven -U clean時,我得到下面的錯誤。Nexus不緩存maven中央插件
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its d
ependencies could not be resolved: Failed to read artifact descriptor for org.ap
ache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not find artifact org.apa
che.maven.plugins:maven-clean-plugin:pom:2.4.1 in nexus (http://localhost:8081/n
exus/content/groups/public) -> [Help 1]
如果我從設置中刪除nexus鏡像並直接轉到maven central,則該命令有效。 nexus中maven repo的設置表明它處於服務狀態,並且位於公共組(最後列出)中。
我並不支持訪問互聯網的代理。
這裏是我的settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<offline>false</offline>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://localhost:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<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>
<profile>
<id>maven-central</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://repo1.maven.org/maven2/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://repo1.maven.org/maven2/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
你能否檢查神器是否是通過網絡訪問它下載的 - http:// localhost:8081/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/2.4.1/ – Raghuram
您是否檢查過通過瀏覽器訪問Nexus並檢查是否可以通過瀏覽器訪問該工件? – khmarbaise
我在這裏添加了更多類似情況的詳細信息:http://stackoverflow.com/questions/13927806/nexus-wont-download-artifacts-from-central/13928041#13928041 –