Return code is: 409, ReasonPhrase:Conflict (JCenter)

6.1k Views Asked by At

I have a artificact deployed in JCenter (oss.jfrog.org) although the deployment did not end without error (see Deploy SNAPSHOT to oss.jfrog.org (JCenter)), the jars are there when I check the Repository browser.

Now I add the dependency in a project for this artifact (library) and adding:

<repositories>
    <!-- Release repository -->
    <repository>
        <id>oss-jfrog-artifactory-releases</id>
        <name>oss-jfrog-artifactory-releases</name>
        <url>http://oss.jfrog.org/artifactory/oss-release-local</url>
    </repository>
    <!-- Snapshot repository -->
    <repository>
        <id>oss-jfrog-artifactory-snapshots</id>
        <name>oss-jfrog-artifactory-snapshots</name>
        <url>http://oss.jfrog.org/artifactory/oss-snapshot-local</url>
    </repository>
</repositories>

When maven started building, it throws this error:

Failed to transfer file: http://oss.jf rog.org/artifactory/oss-release-local/com/myorg/mylibrary/0.0.1-SNAPSHOT/mylibrary-0.0.1-SNAPSHOT.pom. Return code is: 409, ReasonPhrase:Conflict. -> [Help 1]

for the dependency I added. What could be the problem here?

2

There are 2 best solutions below

0
On BEST ANSWER

Try using the virtual repositories

 <repositories>
    <!-- Release repository -->
    <repository>
        <id>oss-jfrog-artifactory-releases</id>
        <name>oss-jfrog-artifactory-releases</name>
        <url>http://oss.jfrog.org/artifactory/libs-release</url>
    </repository>
    <!-- Snapshot repository -->
    <repository>
        <id>oss-jfrog-artifactory-snapshots</id>
        <name>oss-jfrog-artifactory-snapshots</name>
        <url>http://oss.jfrog.org/artifactory/libs-snapshot</url>
    </repository>
</repositories>
0
On

I have a workaround. No idea why, but in my case adding shade plugin to all modules solved the problem, even an empty one:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <configuration>
                <artifactSet>
                </artifactSet>
                <relocations>
                </relocations>
            </configuration>
        </plugin>
    </plugins>
</build>