我试图在我的pom.xml中使用onejar-maven-plugin:
<plugin>
<groupId>org.dstovall</groupId>
<artifactId>onejar-maven-plugin</artifactId>
<version>1.4.4</version>
<executions>
<execution>
<configuration>
<mainClass>com.exmaple.myproj.MpPort_MpSoapPort_Client</mainClass>
<onejarVersion>0.97</onejarVersion>
<attachToBuild>true</attachToBuild>
<classifier>onejar</classifier>
</configuration>
<goals>
<goal>one-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<pluginRepositories>
<pluginRepository>
<id>onejar-maven-plugin.googlecode.com</id>
<url>http://onejar-maven-plugin.googlecode.com/svn/mavenrepo</url>
</pluginRepository>
</pluginRepositories>但是由于某些原因,试图通过Eclipse插件(Maven安装)构建它会导致生成错误:
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository onejar-maven-plugin.googlecode.com (http://onejar-maven-plugin.googlecode.com/svn/mavenrepo)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.dstovall:onejar-maven-plugin
Reason: POM 'org.dstovall:onejar-maven-plugin' not found in repository: Unable to download the artifact from any repository
org.dstovall:onejar-maven-plugin:pom:1.4.4
from the specified remote repositories:
Nexus (https://mynexus.example.com/nexus/content/repositories/central)
for project org.dstovall:onejar-maven-plugin因此,我手动下载了onejar-maven-plugin.jar并通过命令行安装了它,并且我似乎收到了类似的错误:
C:\Users\daniel\myproj>mvn install:install-file -Dfile=onejar-maven-plugin-1.4.4.jar -DgroupId=com.jolira -DartifactId=onejar-maven-plugin -Dversion=1.4.4 -Dpackaging=jar
[INFO] Scanning for projects...
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository onejar-maven-plugin.googlecode.com (http://onejar-maven-plugin.googlecode.com/svn/mavenrepo)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
Downloading: https://mynexus.example.com/nexus/content/repositories/central/org/dstovall/onejar-maven-plugin/1.4.4/onejar-maven-plugin-1.4.4.pom
[INFO] Unable to find resource 'org.dstovall:onejar-maven-plugin:pom:1.4.4' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.dstovall:onejar-maven-plugin
Reason: POM 'org.dstovall:onejar-maven-plugin' not found in repository: Unable to download the artifact from any repository
org.dstovall:onejar-maven-plugin:pom:1.4.4
from the specified remote repositories:
Nexus (https://mynexus.example.com/nexus/content/repositories/central)
for project org.dstovall:onejar-maven-plugin我的理解是,因为我们有一个Nexus镜子,它不包含特定的工件,所以事情会变得混乱。
所以我试着遵循如何强制Sonatype Nexus重新生成/重新索引其元数据上的说明,但是的“浏览索引”选项卡没有这样的上下文菜单!在我们的Sonatype Nexus上。

我读过这里,"Nexus只缓存客户请求的工件,所以您需要设置您的项目poms来请求正确的版本“。但是,,这正是我一直在做的, --结果没有任何变化。
我如何摆脱这种“鸡和蛋”的情况,并得到这个一个罐子-maven-插件。1.4.4对着我的Nexus镜子?
(或者,如何将其放入本地.m2缓存?)
发布于 2013-11-28 02:22:36
您可以强制Maven再次更新和请求依赖项,即使本地回购包含有关-U不可用的工件的元数据。
mvn clean install -U 应该行得通。
另外,您应该将您的settings.xml更改为指向公共组,而不是直接指向中央回购。更多的信息可以找到在尼克斯的书里。
您应该注意到,Central没有尝试使用的onejar插件。查看搜索结果,看看groupId是如何com.joilira而不是org.dstovall的
此外,如果您真的想使用来自org.dstovall的org.dstovall插件,您应该将url http://onejar-maven-plugin.googlecode.com/svn/mavenrepo/作为代理存储库添加到Nexus中,将其添加到公共组中,然后在settings.xml中使用公共组。
https://stackoverflow.com/questions/20252244
复制相似问题