![](/img/trans.png)
[英]Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy Github Packages
[英][error]Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
我在Intellij Idea中創建了Maven項目,並嘗試部署應用程序,我遇到了錯誤。 請幫我解決這個問題。
[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
確保定義了distributionManegement中的repository元素:
<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>
還要檢查maven .m2 / settings.yml文件中的用戶名是否具有將文件PUT(上傳)到工件的權限。
錯誤在於: repository element was not specified in the POM
。 請參閱http://maven.apache.org/pom.html#Repositories以添加元素。
<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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.