存储库元素未在 distributionManagement 元素内的 POM 或 -DaltDep loymentRepository=id::layout::url 参数中指定 [英] repository element was not specified in the POM inside distributionManagement element or in -DaltDep loymentRepository=id::layout::url parameter

查看:37
本文介绍了存储库元素未在 distributionManagement 元素内的 POM 或 -DaltDep loymentRepository=id::layout::url 参数中指定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在部署时遇到问题,这是我收到的错误消息:

I'm having a problem while deploying and here is the error message I get:

[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ core ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.296 s
[INFO] Finished at: 2014-11-26T17:05:00+02:00
[INFO] Final Memory: 13M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:
deploy (default-deploy) on project core: Deployment failed: repository element w
as not specified in the POM inside distributionManagement element or in -DaltDep
loymentRepository=id::layout::url parameter -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

我在互联网上查看了一些资源,但没有一个对我的案例有效.我认为它与我的pom.xml有关,所以这里是它的相关部分:

I checked some resources on the internet and none of them worked for my case. I think it's related to my pom.xml, so here are its related parts:

<build>
        <plugins>
              <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                         <source>1.7</source>
                         <target>1.7</target>
                    </configuration>
              </plugin>
        </plugins>
  </build>

  <repositories>
        <repository>
              <id>repository.springframework.maven.release</id>
              <name>Spring Framework Maven Release Repository</name>
              <url>http://maven.springframework.org/release</url>
        </repository>
        <repository>
              <id>Appid</id>
              <name>AppName</name>
              <url>http://IPaddress/nexus/content/repositories/Myapps/</url>
        </repository>
  </repositories>

您认为问题可能出在哪里?提前致谢.

What do you think the problem might be? Thanks in advance.

推荐答案

您应该在 pom.xml 的分发管理部分中包含要部署的存储库.

You should include the repository where you want to deploy in the distribution management section of the pom.xml.

示例:

<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
                      http://maven.apache.org/xsd/maven-4.0.0.xsd">
...   
<distributionManagement>
    <repository>
      <uniqueVersion>false</uniqueVersion>
      <id>corp1</id>
      <name>Corporate Repository</name>
      <url>scp://repo/maven2</url>
      <layout>default</layout>
    </repository>
    ...
</distributionManagement>
...
</project>

参见分发管理

这篇关于存储库元素未在 distributionManagement 元素内的 POM 或 -DaltDep loymentRepository=id::layout::url 参数中指定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆