我试图让Batik工作,在过去的十年左右没有使用过很多Java而且我遇到了Maven能够找到org.apache.maven.wagon:wagon-ssh-external
包的问题。
当我打开或尝试在Netbeans中构建项目时,它会报告以下错误:
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]
据我所知,这是正确的,但我在项目的pom.xml
文件中有以下内容:
<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>
从我可以判断a)插件应该在其中一个存储库中可用,并且b)如果它们在pom.xml
文件中,Maven应该搜索它们但我看不到它的任何迹象这样做。
我正在尝试使用的项目是the FreeHEP EMF driver.更大的屏幕解决方案是使用未标记但更新的Github repository版本。
答案 0 :(得分:1)
事实证明解决方案毕竟是在消息中:解析插件的版本时出错。
很明显它不是repository
它是pluginRepository
,它位于pom.xml
的不同部分:
<pluginRepositories>
<pluginRepository>
<id>maven1</id>
<name>Maven.org</name>
<url>http://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
答案 1 :(得分:0)
删除带有repo1...
的条目,因为这是maven Central,默认情况下由Maven使用,因此无需明确定义它。此外,通过Maven Central也可以获得给定的freehep.org
。因此,如果我认为它是正确的,您根本不需要定义补充存储库。