Maven cannot find Axis2 1.6.4 or higher
Asked Answered
O

1

10

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?

Osmond answered 16/10, 2016 at 20:59 Comment(0)
F
17

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.

Flower answered 17/10, 2016 at 23:6 Comment(2)
So by default maven tries to download a jar. Why isn't maven smart enough to realise that if the jar isn't present, he should try the only other alternative, namely the pom?Osmond
Well, that I don't know. I suppose it's strict behaviour. Maven expects the programmer to know what it is supposed to download.Flower

© 2022 - 2024 — McMap. All rights reserved.