2013-03-14 11 views
13

Ho integrato Maven con Eclipse e sto provando a creare un progetto maven. Ogni volta che sto provando a creare un progetto, il suo POM.xml mostra un errore.Plugin org.apache.maven.plugins: maven-resources-plugin: 2,5 o una delle sue dipendenze non possono essere risolti: UnresolvedAddressException

Multiple annotations found at this line: - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) - Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile) - CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from htt:///repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (htt:///repo.maven.apache.org/maven2): null to htt://
repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom

Se provo a eseguire maven-install o qualsiasi altra opzione di esecuzione. ottengo questo errore

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See htt://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [INFO] Scanning for projects... [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building CQ5 MyApp UI 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.289s [INFO] Finished at: Thu Mar 14 14:39:09 IST 2013 [INFO] Final Memory: 1M/15M [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (htt://repo.maven.apache.org/maven2): null to htt://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom: UnresolvedAddressException -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Cosa devo fare?

+0

Potete pubblicare il vostro pom.xml?. –

risposta

2

Sembra che potrebbe essere necessario aggiungere la dipendenza sl4j nel file pom. Vedi qui: Failed to load class "org.slf4j.impl.StaticLoggerBinder"

Ecco la depenedency dal Finder dipendenza nel CQ5.5:

<dependency> 
    <groupId>org.apache.sling</groupId> 
    <artifactId>org.apache.sling.commons.log</artifactId> 
    <version>2.1.3-R1232904</version> 
    <scope>provided</scope> 
</dependency> 

Speranza che aiuta e buona fortuna.

18
  1. Se stai lavorando su Windows come me, vai su C: \ Users \ Owner.m2 \ repository ed elimina tutti i file in esso contenuti. Assicurati di mantenere chiusa l'eclisse.
  2. Aprire l'eclissi e fare clic con il pulsante destro del mouse sul progetto, quindi fare clic su Maven e quindi su Aggiorna progetto. Viene visualizzata una finestra di dialogo, assicurati di aver selezionato le opzioni "progetti puliti" e "aggiorna configurazione progetto da pom.xml".

Questo dovrebbe cancellare tutti gli errori nel progetto. :)

+0

ha funzionato anche sul mio mac –

+0

funziona! grazie :) – jondinham

+0

funziona come un fascino, TY – Yuri

3

Grazie a tutti voi per l'aiuto e la guida. Ho avuto l'errore anch'io. Sono in una rete proxy e mi è stato richiesto di impostare l'ID utente e la password nel file settings.xml di apache Maven.

+0

rDX puoi incollare lo snippet per dare il credienital \ – Sridhar

4

Non è necessario eliminare tutto dalla directory .m2 \ repository. Solo le directory per "librerie problematiche", nel tuo esempio YOUR_MAVEN_REPO.m2 \ repository \ org \ apache \ maven \ plugins \ maven-compiler-plugin ed elimina la cartella 2.3.2.

Quindi fare clic con il tasto destro del mouse sul progetto in Eclipse e Maven-> Aggiorna progetto. Probabilmente otterrai un errore diverso e dovrai ripetere la procedura. Fatelo 3-4 volte e dovrebbe andare bene ...

Problemi correlati