2

I'm trying to release a project to azure artefacts, the project pom is like this

<?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>
<parent>
    <groupId>groupId</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.1</version>
</parent>
<groupId>groupId.groupId</groupId>
<artifactId>sftp-service</artifactId>
<version>1.0.2-SNAPSHOT</version>
<packaging>bwmodule</packaging>


<dependencies>
    <dependency>
        <groupId>groupId</groupId>
        <artifactId>sftp-api</artifactId>
        <version>1.0.5</version>
    </dependency>
</dependencies>

<build>
    <sourceDirectory>src</sourceDirectory>
    <outputDirectory>target/classes</outputDirectory>
    <plugins>
        <plugin>
            <groupId>com.tibco.plugins</groupId>
            <artifactId>bw6-maven-plugin</artifactId>
            <extensions>true</extensions>
        </plugin>
    </plugins>
</build>

<scm>
    <developerConnection>scm:git:https://url_to_git_repo</developerConnection>
  <tag>HEAD</tag>

when executing

mvn release:perform

I face the folowing error

[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.0.0-M1:deploy (default-deploy) on project sftp-service: ArtifactDeployerException: Failed to deploy artifacts: Could not transfer artifact sftp-service:jar:1.0.1 from/to repo-release (https://pkgs.dev.azure.com/groupename/_packaging/repo-release/maven/v1): Failed to transfer file https://pkgs.dev.azure.com/groupename/_packaging/repo-release/maven/v1/up/coop/esb/sftp-service/1.0.1/sftp-service-1.0.1.jar with status code 409 -> [Help 1]

When I look at the repository, I can see that the package is uploaded successfully

Anouar BAKRI
  • 314
  • 2
  • 13

1 Answers1

2

Error “Failed to transfer file *.jar with status code 409” despite transfered

According to the pom and error log, it seems you are trying to deploy a snapshot version into a release only repository.

In your pom, you are set the <version>1.0.2-SNAPSHOT</version>, but in the error log, you are deploy artifacts to repo-release. Hence the conflict.

To resolve this issue, please try to select a snapshot repository instead of a release one in your pom.xml or select a release library rather than the snapshot library for your release version.

Check this thread for some more details.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135