【maven】maven 項目 deploy 報錯:Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7


=======================

 

參考地址:

https://blog.csdn.net/liuxiao723846/article/details/52604377

 

 

報錯:

maven 項目 deploy  報錯:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project 項目名XXX: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRep
ository=id::layout::url parameter

 

 

 

 

報錯原因:

意思是在pom文件中缺少distributionManagement標簽,或者缺少-DaltDeployementRepositoty,說的是缺少deploy的地址,maven不知道你想要deploy到哪里,在pom文件中增加如下信息,就發布成功了.

 

解決方法:

<distributionManagement>
       
        <snapshotRepository>
            <id>nexus</id>
            <name>snapshots</name>
            <url>http://XXXXXXXXXXXXX/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

<distributionManagement>
        <repository>
            <id>nexus</id>
            <name>releases</name>
            <url>http://mvn2.qdingnet.com/nexus/content/repositories/releases</url>
            <uniqueVersion>true</uniqueVersion>
        </repository>
        <snapshotRepository>
            <id>nexus</id>
            <name>snapshots</name>
            <url>http://XXXXXXXXXXXXX/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM