2016-03-08 2 views
-1

Salut, J'ai créé un nouvel artefact maven en utilisant archiva, afin de partager des projets de pots mis à jour avec mon équipe. lorsque je tente de déployer le projet, je suis arrivé ce échec:Le déploiement de Maven a échoué?

downloading: http://**VirtualMachineName:8888/groupId**/webInfra/0.0.1-SNAPSHOT/maven-metadata.xml 
[WARNING] Could not transfer metadata **groupId**:webInfra:0.0.1-SNAPSHOT/maven-metadata.xml from/to stmaven (http://**VirtualMachineName:8888**): Failed to transfer http://**VirtualMachineName:8888/groupId**/webInfra/0.0.1-SNAPSHOT/maven-metadata.xml. Error code 504, Proxy Timeout (The connection timed out. ) 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 01:05 min 
[INFO] Finished at: 2016-03-08T10:04:00+02:00 
[INFO] Final Memory: 14M/249M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project webInfra: Failed to retrieve remote metadata il.co.stms-automation:webInfra:0.0.1-SNAPSHOT/maven-metadata.xml: Could not transfer metadata **groupId**:webInfra:0.0.1-SNAPSHOT/maven-metadata.xml from/to stmaven (http://VirtualMachineName:8888): Failed to transfer http://**VirtualMachineName:8888/groupId**/webInfra/0.0.1-SNAPSHOT/maven-metadata.xml. Error code 504, Proxy Timeout (The connection timed out. ) -> [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 

this what I added to pom.xml file: 

    <repository> 
     <id>stmaven</id> 
     <name>stmaven</name> 
     <url>http://stmaven:8888</url> 
    </repository> 


what added to setting.xml file: 
<servers> 

    <server> 
     <id>VirtualMachineName</id> 
     <username>user</username> 
     <password>pass</password> 
    </server> 
    <!----> 


    </servers> 


    <mirrors> 

    <mirror> 
     <id>mirrorId</id> 
     <mirrorOf>archiva</mirrorOf> 
     <name>maven archiva Mycompany</name> 
     <url>http://VirtualMachineName:8888/#browse/**groupId**</url> 
    </mirror> 

    </mirrors> 

Note: Je suis très nouveau avec la création et de maintenir un dépôt Maven.

Merci

+0

Herer est le problème. 'Code d'erreur 504, Proxy Timeout'. – khmarbaise

+0

Proxy déclaré dans le fichier settings.xml, dois-je le déclarer à un autre endroit? –

+0

Peu importe que vous l'ayez déclaré ... le point est qu'il a le timeout ... – khmarbaise

Répondre

3

Vous devez déclarer le paramètre ci-dessous dans le POM:

<distributionManagement> 

    <repository> 
     <id>releases</id> 
     <name>Releases</name> 
     <url>http://localHost:8080/repository/YourRepo/</url> 
    </repository> 

    <snapshotRepository> 
     <id>snapshots</id> 
     <name>Snapshots</name> 
     <url>http://localHost:8080/repository/YourRepo/</url> 
    </snapshotRepository> 
</distributionManagement> 

Les deux référentiel (version et instantanés) pointent dans la même prise en pension à archiva

L'option Snapshot doit être activée sur YourRepo dans l'archive

vous devez déclarer le paramètre ci-dessous dans le fichier XML de réglage:

<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"> 
<servers> 
<server> 
    <id>YourRepo</id> 
    <username>admin</username> 
    <password>password</password> 
</server> 
<server> 
    <id>releases</id> 
    <username>admin</username> 
    <password>password</password> 
</server> 
</servers> 
</settings> 

Après que vous pouvez exécuter: mvn deploy

Il travaille pour moi

+0

vous êtes: D, big beeed –