repository element was not specified in the POM inside distributionManagement element or in -DaltDep loymentRepository=id::layout::url parameter

前端 未结 3 1637
我寻月下人不归
我寻月下人不归 2020-12-01 05:09

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

[INFO]
[INFO] --- maven-deploy-plugin:2.7         


        
相关标签:
3条回答
  • 2020-12-01 05:28

    In your pom.xml you should add distributionManagement configuration to where to deploy.

    In the following example I have used file system as the locations.

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

    you can add another location while deployment by using the following command (but to avoid above error you should have at least 1 repository configured) :

    mvn deploy -DaltDeploymentRepository=internal.repo::default::file:///home/thara/testesb/in
    
    0 讨论(0)
  • 2020-12-01 05:34

    The issue is fixed by adding repository url under distributionManagement tab in main pom.xml.

    Jenkin maven goal : clean deploy -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>
    
    0 讨论(0)
  • 2020-12-01 05:36

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

    Example:

    <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>
    

    See Distribution Management

    0 讨论(0)
提交回复
热议问题