Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the Maven warning, "The artifact...has been relocated to..." mean?

Tags:

I am getting these warnings when I attempt to run package.

[WARNING] The artifact org.apache.commons:commons-io:jar:1.3.2 has been relocated to commons-io:commons-io:jar:1.3.2

[WARNING] The artifact axis:axis-ant:jar:1.4 has been relocated to org.apache.axis:axis-ant:jar:1.4
like image 933
pitchblack408 Avatar asked Feb 20 '15 07:02

pitchblack408


People also ask

What is Maven artefact?

A Maven artifact is a reference to a Maven artifact stored in a Maven repository. These artifacts are generally consumed by stages that deploy application artifacts, such as a Deploy stage.

What is Maven artifact manager?

Maven is a project development management and comprehension tool. Based on the concept of a project object model: builds, dependency management, documentation creation, site publication, and distribution publication are all controlled from the declarative file.

What is missing artifact error in POM xml?

The error in pom. xml “missing artifact maven” occurs when the artifact is missing in local repository and remote repository. In eclipse, missing artifact maven error shows in the programs window. Maven is a software tool for building artifacts.


2 Answers

in your dependency declaration change groupId from org.apache.commons to commons-io

like image 157
jmj Avatar answered Sep 19 '22 12:09

jmj


JFYI: it works this way: org.apache.commons:commons-io:jar:1.3.2 pom contains new groupId/artifactId of artifact to avoid possible jar hell with intersecting classpaths from different artifacts:

  <distributionManagement>
    <relocation>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <message>https://issues.sonatype.org/browse/MVNCENTRAL-244</message>
    </relocation>
  </distributionManagement>

and maven replaces the dependency automatically. Another example: org.hibernate:hibernate-validator relocates to another groupId.

like image 40
seregamorph Avatar answered Sep 16 '22 12:09

seregamorph