2

I am setting up the JFrog Artifactory for our artifact management (maven). I copied the settings.xml to ~/.m2 and all artifact downloads working fine. But when I try to deploy the artifacts from my webapp I am getting the below error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) 
on project gs-spring-boot: Deployment failed: 
repository element was not specified in the POM inside
distributionManagement element or in 
-DaltDeploymentRepository=id::layout::url parameter -> [Help 1]

Here is my settings.xml

    <?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
      <username>admin</username>
      <password>AP4L8krxktj27QuV7CNvmGiSLPW</password>
      <id>central</id>
    </server>
    <server>
      <username>admin</username>
      <password>AP4L8krxktj27QuV7CNvmGiSLPW</password>
      <id>snapshots</id>
    </server>
  </servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://localhost:8081/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://localhost:8081/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://localhost:8081/artifactory/libs-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://localhost:8081/artifactory/libs-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
</settings>

Here is my pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
<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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.springframework</groupId>
    <artifactId>gs-spring-boot</artifactId>
    <version>0.1.0</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.3.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>

    <properties>
        <java.version>1.8</java.version>
    </properties>

<distributionManagement>
    <snapshotRepository>
        <id>snapshots</id>
        <name>localhost.localdomain-snapshots</name>
        <url>http://localhost:8081/artifactory/libs-snapshot-local</url>
    </snapshotRepository>
</distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

I am running mvn deploy

What is the mistake I am doing here?

Rajeshkumar
  • 815
  • 12
  • 35
  • 2
    This can't work cause you have defined a version `0.1.0` which is a release version which means the deployment will go to a release repository which you haven't defined in distributionManagement only snapshot repository...you need to define alway both...apart from that I would recommend to define a SNAPSHOT version first...before you make releases... – khmarbaise Apr 26 '17 at 16:50
  • 1
    Thanks a lot. Simple and clean. – Rajeshkumar Apr 26 '17 at 17:31
  • 1
    It seems that the user that commented first assisted you but for future cases, DO NOT share your username and password as clear text. This is unsecured. I've edited your question and removed those from the post. – Ariel Apr 26 '17 at 19:00
  • 1
    any link to information on the deploy step? dont really understand the details – filthy_wizard Apr 30 '17 at 09:34

0 Answers0