5

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?

Community
  • 1
  • 1
quarks
  • 33,478
  • 73
  • 290
  • 513
  • In my case, Apache Archiva had not the correct rights to access the repository (read access was OK but write access was KO) which prevented me to deploy files due to 409 error. – Francois Marot Jul 24 '18 at 09:24

2 Answers2

4

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>
richard
  • 56
  • 2
1

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>
Paweł Prażak
  • 3,091
  • 1
  • 27
  • 42