为什么我的maven项目没有从nexus拿起jar

Var*_*run 0 nexus maven jenkins

我上Redhat,用jenkinsNexus Repository Manager OSS 2.12.0-01.

我想要实现的是从nexus下载所有jar.什么,我已经完成了.成功安装nexus 2.12.0-01

这是我的maven的内容 setting.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0                                                                                                                   
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
 

    <mirrors>
        <mirror>
        <!--This sends everything else to /public -->
            <id>nexus</id>
            <mirrorOf>*</mirrorOf>
            <url>http://localhost:8081/nexus/content/groups/public</url>
        </mirror>
    </mirrors>

    <profiles>
        <profile>
            <id>nexus</id>
            <!--Enable snapshots for the built in central repo to direct -->
            <!--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>
    <!--make the profile active all the time -->
        <activeProfile>nexus</activeProfile>
    </activeProfiles>
</settings> 
Run Code Online (Sandbox Code Playgroud)

在nexus中成功安装了Ojdbc5的第三方jar 在此输入图像描述

我父母的内容

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.abc</groupId>
  <artifactId>Test</artifactId>
  	<packaging>pom</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <modules>
    <module>Project1</module>
    <module>Project2</module>
 </modules>
 
 <distributionManagement>
    <snapshotRepository>
        <id>my-snapshots</id>
        <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
    </snapshotRepository>

    <repository>
        <id>my-releases</id>
        <url>http://localhost:8081/nexus/content/repositories/releases</url>
    </repository>

</distributionManagement>
</project>
Run Code Online (Sandbox Code Playgroud)

在上面pom.xml有两个项目定义.当我使用jenkins构建时,第一个项目成功构建.但第二个抛出错误.

未能就项目的项目2执行的目标:无法解析相关项目com.abc:project2:war:0.0.1-SNAPSHOT:未能找到com.oracle:ojdbc5:jar:11.2.0.1中 的http://本地主机:8081/nexus/content/groups/public缓存在本地存储库中,在nexus的更新间隔已经过去或强制更新之前,不会重新尝试解析 - > [帮助1]

请参阅项目2 pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.abc</groupId>
  <artifactId>project2</artifactId>
    <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>Maven Webapp</name>
  <url>http://localhost:8081/nexus/content/repositories/releases</url>

 <distributionManagement>
  <repository>
    <id>thirdparty</id>
    <url>http://localhost:8081/nexus/content/repositories/thirdparty</url>
  </repository>
</distributionManagement>

  <dependencies>
        <!-- Spring ORM support -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>3.2.13.RELEASE</version>
        </dependency>

        <!-- Spring Batch -->
        <dependency>
            <groupId>org.springframework.batch</groupId>
            <artifactId>spring-batch-core</artifactId>
            <version>3.0.1.RELEASE</version>
        </dependency>

        <!-- ojdbc 5 dependency provide by nexus-->

        <dependency>
         <groupId>com.oracle</groupId>
         <artifactId>ojdbc5</artifactId>
         <version>11.2.0.1</version>
        </dependency>
    <!-- That is creating problem -->
Run Code Online (Sandbox Code Playgroud)

请不要担心上面pom.xml我已经从pom中删除了很多依赖,以减少问题的大小.pom结构好了.

现在开始质疑.我错过了任何配置,为什么我得到了

未能就项目gsdataprocessor执行目标:无法解析项目com.globalss.batch依赖关系:gsdataprocessor:战争:0.0.1-快照:未能找到com.oracle:ojdbc5:jar:11.2.0.1 的http://本地主机:8081/nexus/content/groups/public缓存在本地存储库中,在nexus的更新间隔已经过去或强制更新之前,不会重新尝试解析 - > [帮助1]

这个错误.请帮忙

更新1:根据用户的建议,sanigo我已将Thirdpary存储库添加到公共存储库组

更新2:下面是显示oracle ojdbc5可用的屏幕短片是公共存储库. 在此输入图像描述 在此输入图像描述

san*_*igo 5

的http://本地主机:8081 /关系/内容/组/公共(公共库集团)是"*"镜子,所以你应该添加的http://本地主机:8081 /关系/内容/库/第三方(第三方 repositoy )到Public Repository Group,您可以在Public Repository Configuration选项卡中执行此操作.然后你可以使用mvn -U clean install.