首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >[错误]无法执行目标org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy

[错误]无法执行目标org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
EN

Stack Overflow用户
提问于 2013-04-16 17:57:31
回答 2查看 43.6K关注 0票数 9

我在Intellij Idea中创建了Maven-project,在尝试部署应用程序时,我遇到了一个错误。请帮我解决这个问题。

代码语言:javascript
复制
 [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
EN

回答 2

Stack Overflow用户

发布于 2016-12-01 23:46:24

确保在distributionManegement中定义了存储库元素:

代码语言:javascript
复制
<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文件中的用户名是否有权限将文件上传到artifactory。

票数 2
EN

Stack Overflow用户

发布于 2013-04-16 22:56:52

错误在这里:repository element was not specified in the POM。要添加元素,请参阅http://maven.apache.org/pom.html#Repositories

代码语言:javascript
复制
<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>
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16034018

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档