glenatron
glenatron

Reputation: 11372

Maven: Error resolving version for plugin

I am trying to get Batik working, having not worked with Java much in the last ten years or so and I'm running into problems with Maven being able to find the org.apache.maven.wagon:wagon-ssh-external package.

When I open or try to build the project in Netbeans, it reports the following error:

   The project org.freehep:freehep-graphicsio:2.1.1 (/home/glenatron/Projects/batik/freehep-graphicsio/pom.xml) has 1 error
     Unresolveable build extension: 
     Error resolving version for plugin 'org.apache.maven.wagon:wagon-ssh-external' from the repositories [local (/home/glenatron/.m2/repository), freehep-maven (http://java.freehep.org/maven2), central (http://www.ibiblio.org/maven2), Codehaus (http://repository.codehaus.org/), Codehaus Snapshots (http://snapshots.repository.codehaus.org/)]:
     Plugin not found in any plugin repository -> [Help 2]

As far as I can tell this is correct, however, I have the following in my pom.xml file for the project:

<repositories>
    <repository>
      <id>freehep-maven</id>
      <name>Maven FreeHEP</name>
      <url>http://java.freehep.org/maven2</url>
    </repository>
    <repository>
        <id>maven-apache</id>
        <name>Maven Apache</name>
        <url>http://repo.maven.apache.org/maven2</url>
    </repository>
    <repository>    
        <id>maven1</id>
        <name>Maven.org</name>
        <url>http://repo1.maven.org/maven2</url>
    </repository>
  </repositories>

From what I can judge a) that plugin should be available in one of those repositories and b) if they are in the pom.xml file, Maven should be searching them but I can't see any sign of it doing that.

The project I am trying to work with is the FreeHEP EMF driver. The bigger screen solution was to use the unsignposted but much more up to date Github repository version.

Upvotes: 2

Views: 16703

Answers (3)

raisercostin
raisercostin

Reputation: 9219

In my case the problem was that the plugin didn't specify a version and the mechanism for mirroring wanted to directly access repositories instead the mirror to my local file.

Upvotes: 1

glenatron
glenatron

Reputation: 11372

It turns out that the solution was in the message after all: Error resolving version for plugin.

So obviously it's not a repository it is a pluginRepository which goes in a different part of pom.xml:

<pluginRepositories>
    <pluginRepository>    
        <id>maven1</id>
        <name>Maven.org</name>
        <url>http://repo1.maven.org/maven2</url>
    </pluginRepository>
</pluginRepositories>

Upvotes: 3

khmarbaise
khmarbaise

Reputation: 97547

Remove the entries with repo1... cause this is maven Central and used by Maven by default so no need to define it explicit. Furthermore the given freehep.org is also available via Maven Central. So if i see it correct you don't need to define supplemental repositories at all.

Upvotes: 0

Related Questions