Wit*_*eld 17 maven-2 nexus m2eclipse sonatype maven
我想在我的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>
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,尝试通过Eclipse Maven插件(Maven安装)构建它会导致BUILD ERROR:
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
Run Code Online (Sandbox Code Playgroud)
所以我手动下载了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
Run Code Online (Sandbox Code Playgroud)
我的理解是因为我们有一个Nexus镜像,它不包含那个特殊的神器,所以事情会变得混乱.
所以我尝试按照如何强制Sonatype Nexus重新生成/重新索引其元数据的说明,但"浏览索引"选项卡没有这样的上下文菜单!在我们的Sonatype Nexus上.

我在这里读到"Nexus只缓存客户要求的工件.所以你需要设置你的项目poms来请求正确的版本".但这正是我一直在做的事情 - 结果没有任何改变.
如何摆脱这种"鸡蛋和鸡蛋"的情况并获得这个onejar-maven-plugin ver.1.4.4进入我的Nexus镜像?
(或者,如何将其放入我的本地.m2缓存?)
Man*_*ser 23
即使本地存储包含有关-U不可用的工件的元数据,您也可以强制Maven再次更新和请求依赖关系
mvn clean install -U
Run Code Online (Sandbox Code Playgroud)
应该管用.
此外,您应该更改settings.xml为指向公共组而不是直接指向中央存储库.更多内容可以在Nexus书中找到.
您应该注意,Central Repository没有onejar您尝试使用的插件.退房的搜索结果,并了解groupId是com.joilira不org.dstovall
如果你真的想使用你的onejar插件,org.dstovall你应该添加网址http://onejar-maven-plugin.googlecode.com/svn/mavenrepo/作为Nexus的代理存储库,将其添加到公共组然后使用你公共团体settings.xml
| 归档时间: |
|
| 查看次数: |
33649 次 |
| 最近记录: |