Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven cannot find Axis2 1.6.4 or higher

Tags:

maven

axis2

As clearly visible here, the Axis 2 Maven dependency has several versions higher than version 1.6.3. However, they all fail to download when I build (actually when I edit & save my pom.xml) in Eclipse. I have a java 8 project and version 1.5.4 through 1.6.3 all work. when I add them to my pom.xml, they automatically appear in my maven dependencies. when I try any version ranging from 1.6.4 - 1.7.3, I get a missing artifact error in my pom.xml, like they cannot be found in the central repository.

enter image description here

enter image description here

I use Eclipse Mars's embedded Maven 3.3. Could it be that it is linked to an outdated repository which does not contain the ne versions? How can I connect it to another repository (I alreacy checked Preferences/Maven to set this property but didn't find one). Additionally, what would be a good "central" repository?

like image 905
user1884155 Avatar asked Oct 16 '16 20:10

user1884155


1 Answers

This error is not as you have understood:

Pass the mouse over the red underline (or go to the "markers" tab) and read the error message:

Missing artifact org.apache.axis2:axis2:jar:1.6.4

Realise that Maven is trying to download such an artifact with these coordinates: groupId=org.apache.axis2, artifactId=axis2, version=1.6.4, type=jar

... and it happens that, from version 1.6.4 on, the artifact axis2 is not a JAR anymore, but a POM. So you have just to override the default type coordinate:

    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.6.4</version>
        <type>pom</type>
    </dependency>

(Or else, declare another more specific artifact with JAR packaging: axis2-kernel, axis2-adb, etc.)

Suggestion: Take a look at this search in Central Repository and realise how some dependencies have a JAR artifact while some others just have a POM.

like image 70
Little Santi Avatar answered Sep 21 '22 11:09

Little Santi