2013-04-16 17 views
6

Ho creato il progetto Maven in Intellij Idea e con il tentativo di distribuire l'applicazione, ho ottenuto un errore. Aiutami a risolvere questo problema, per favore.[errore] Impossibile eseguire l'obiettivo org.apache.maven.plugins: maven-deploy-plugin: 2.7: deploy

[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project Er-Fly: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter -> [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/MojoExecutionException 
+0

esegue il comando con l'opzione -X come consigliato nell'output. Questo sputerà l'intero stacktrace, che renderà più facile capire il problema. –

+0

Quale comando stai utilizzando? Sembra che tu stia cercando di spingere artefatti in un repository remoto (gestione della distribuzione). A quanto pare, la risposta @Rocologo è corretta. – SylvesterAbreu

risposta

-2

L'errore è qui: repository element was not specified in the POM. Vedere http://maven.apache.org/pom.html#Repositories per aggiungere l'elemento.

<project xmlns="http://maven.apache.org/POM/4.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
         https://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    ... 
    <repositories> 
    <repository> 
     <releases> 
     <enabled>false</enabled> 
     <updatePolicy>always</updatePolicy> 
     <checksumPolicy>warn</checksumPolicy> 
     </releases> 
     <snapshots> 
     <enabled>true</enabled> 
     <updatePolicy>never</updatePolicy> 
     <checksumPolicy>fail</checksumPolicy> 
     </snapshots> 
     <id>codehausSnapshots</id> 
     <name>Codehaus Snapshots</name> 
     <url>http://snapshots.maven.codehaus.org/maven2</url> 
     <layout>default</layout> 
    </repository> 
    </repositories> 
    <pluginRepositories> 
    ... 
    </pluginRepositories> 
    ... 
</project> 
0

Assicurarsi di avere il repository elemento nel distributionManegement definito:

<distributionManagement> 
    <repository> 
     <id>central</id> 
     <name>plugins-releases</name> 
     <url>http://serverip:8081/artifactory/plugins-release-local</url> 
    </repository> 
    <snapshotRepository> 
     <id>snapshots</id> 
     <name>plugins-snapshot</name> 
     <url>http://serverip:8081/artifactory/plugins-snapshot-local</url> 
    </snapshotRepository> 
</distributionManagement> 

Controllare anche che il nome utente nel tuo Maven file in .m2/settings.yml ha il permesso di PUT (caricare) i file per l'artefatto.

Problemi correlati