Im utilizzando Maven 3.0.4 e Nexus 2.0.6. Ho impostato il mio settings.xml come mostra l'istruzione Nexus per l'utilizzo di un singolo repository. Viene visualizzato l'errore qui sotto quando Maven tenta di eseguire Maven -U clean.Nexus non memorizza i plugin centrali 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]
Se rimuovo il nexus mirror dalle impostazioni e si passa direttamente a Maven central, il comando funziona. Le impostazioni per il repository Maven in nexus mostrano che è in servizio ed è nel gruppo pubblico (il suo ultimo elenco).
Non sono dietro un proxy per accedere a Internet.
Ecco il mio 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>
Puoi verificare se l'artefatto è stato scaricato da nexus accedendo tramite il web - http: // localhost: 8081/nexus/content/groups/public/org/apache/maven/plugins/maven-clean-plugin/2.4.1/ – Raghuram
Hai controllato l'accesso a Nexus tramite il browser e hai controllato se puoi accedere agli artefatti anche tramite browser? – khmarbaise
Ho aggiunto più dettagli per la mia situazione simile qui: http://stackoverflow.com/questions/13927806/nexus-wont-download-artifacts-from-central/13928041#13928041 –