未在POM内部distributionManagement元素或-DaltDep loymentRepository = id :: layout :: url参数中指定存储库元素

 小桃爱学PHP 发布于 2022-12-09 15:26

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

[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,所以这里有相关部分:


        
              
                    org.apache.maven.plugins
                    maven-compiler-plugin
                    2.3.2
                    
                         1.7
                         1.7
                    
              
        
  

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

您认为问题可能是什么?提前致谢.

3 个回答
  • 您应该在您的分发管理部分中包含要部署的存储库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>
    

    请参阅分发管理

    2022-12-11 02:04 回答
  • 通过在主pom.xml中的distributionManagement选项卡下添加存储库URL可以解决此问题。

    詹金Maven目标:干净部署-U -Dmaven.test.skip = true

    <distributionManagement>
        <repository>
            <id>releases</id>
            <url>http://domain:port/content/repositories/releases</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <url>http://domain:port/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    

    2022-12-11 02:11 回答
  • 在您的pom.xml中,您应该将distributionManagement配置添加到部署位置.

    在以下示例中,我使用文件系统作为位置.

    <distributionManagement>
           <repository>
             <id>internal.repo</id>
             <name>Internal repo</name>
             <url>file:///home/thara/testesb/in</url>
           </repository>
       </distributionManagement>
    

    您可以使用以下命令在部署时添加其他位置(但为了避免上述错误,您应该至少配置1个存储库):

    mvn deploy -DaltDeploymentRepository=internal.repo::default::file:///home/thara/testesb/in
    

    2022-12-11 02:56 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有