gpt4 book ai didi

maven - Artifact 已下载,但未从我的单个 Nexus 服务器使用

转载 作者:行者123 更新时间:2023-12-01 16:02:15 25 4
gpt4 key购买 nike

我是 Nexus 新手,正在尝试针对我的单个 Nexus 服务器运行 Maven 项目。在运行项目时(已知可以正确构建和运行的 Spring Roo 示例),除了两个里程碑 jar 之外,其他所有 jar 都已加载。我的答案(也许不是最好的)是找到并直接(使用 POM)将 jar 上传到我的 Nexus 服务器(托管 repo)中,然后我将其放在公共(public)组中。

重新运行 mvn 项目时(使用 mvn package tomcat:run),这 2 个文件似乎从服务器下载(见下面的控制台输出),但 mvn 项目仍然找不到。为什么该项目显然会调用它们但不使用它们?谢谢。

这是控制台输出,显示正在下载,但没有被项目使用,还有我的 settings.xml(有问题的 jar 是 aspectjrt-1.6.11.M1 和 aspectjweaver-1.6.11.M1):

Last login: Mon Nov 14 06:03:25 on console
Macintosh-2:~ wlaprise$ cd coursemanager/
Macintosh-2:coursemanager wlaprise$ mvn package tomcat:run
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Course Manager Chapter 4 0.1.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.pom
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.pom (909 B at 0.5 KB/sec)
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.pom
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.pom (912 B at 1.0 KB/sec)
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.annotations/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.osgi.bundle/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/springframework/roo/org.springframework.roo.root/1.2.0.BUILD-SNAPSHOT/maven-metadata.xml
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.jar
Downloading: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjweaver/1.6.11.M1/aspectjweaver-1.6.11.M1.jar
Downloaded: http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public/org/aspectj/aspectjrt/1.6.11.M1/aspectjrt-1.6.11.M1.jar (1640 KB at 689.5 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.607s
[INFO] Finished at: Mon Nov 14 06:17:42 CST 2011
[INFO] Final Memory: 5M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project course-manager-chapter-04: Could not resolve dependencies for project org.rooinaction.coursemanager:course-manager-chapter-04:war:0.1.0.BUILD-SNAPSHOT: Could not find artifact org.aspectj:aspectjweaver:jar:1.6.11.M1 in nexus (http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Macintosh-2:coursemanager wlaprise$

设置.xml -
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://www.c3works.com:8081/nexus-webapp-1.9.1.1/content/repositories/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
<pluginGroups>
<pluginGroup>com.sonatype.maven.plugins</pluginGroup>
<pluginGroup>org.sonatype.plugins</pluginGroup>
</pluginGroups>
</settings>

最佳答案

首先是网址 http://central很好。它是一个从未使用过的虚拟占位符,因为您定义了镜像。

但是,您使用的镜像 url 很可能是错误的。通常,Nexus 中的存储库是托管或代理的,然后聚合到一个公共(public)“组”中。

公共(public)组的 url 默认 url 是 http://localhost:8081/nexus/content/groups/public/
如果您在 apache 后面进行代理或在端口 80 上运行,则将 localhost 替换为您的服务器并省略端口。

无论如何..重点是网址是/content/GROUPS/public ..您的网址很可能是错误的。测试只需在浏览器中尝试镜像中的 url。

当然,您希望在公共(public)组中可用的所有存储库都必须添加到其中。

关于maven - Artifact 已下载,但未从我的单个 Nexus 服务器使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8124884/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com