Konfigurieren pom.xml Datei-Repository-manager Nexus

Ich bin mit Redhat, java 1.7, maven 3.2.5, jenkins 1.6,git version 2.0.5 und nexus-2.12.0-01

Habe ich einen Lokalen Nexus Repository für meine innere Entwicklung.
Nun, Was ich zu tun versuche, ist, zu bauen maven Projekt mit jenkins mit Nexus Repository Manger Oss.
Ich bin in der Lage zu bauen, mein Projekt ohne Nexus Repository Manger Oss.

Hinweis : ich bin mit übergeordneten pom da muss ich sub-Projekte.

Unten sind die Schritte, die ich gefolgt.

  • Installiert Nexus Repository Manger Oss. Es ist und läuft

    hier ist der screen-shot.
    Konfigurieren pom.xml Datei-Repository-manager Nexus

  • Installiert ojdbc5 jar im nexus-repository

Konfigurieren pom.xml Datei-Repository-manager Nexus

  • Gemacht, notwendige Veränderungen in der setting.xml Datei .m2 Ordner

hier der Inhalt 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>

    <activeProfiles>
        <!--make the profile active all the time -->
        <activeProfile>nexus</activeProfile>
    </activeProfiles>

    <profiles>
        <profile>
            <id>nexus</id>
          <repositories>
          <repository>
          <id>central</id>
          <url>http://maven.apache.org</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
          </repository>
            </repositories>

            <pluginRepositories>
                <pluginRepository>
                    <id>central</id>
                    <url>http://maven.apache.org</url>
                    <releases><enabled>true</enabled></releases>
                    <snapshots><enabled>true</enabled></snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

    <servers>
      <server>
       <id>releases</id>
       <username>deployment</username>
       <password>deployment123</password>
      </server>
      <server>
        <id>snapshots</id>
        <username>deployment</username>
        <password>deployment123</password>
      </server>
    </servers>

</settings> 
  • Hinzugefügt die details des nexus repository in meine pom.xml

Eltern pom.xml Inhalt

HTML:

<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>parent</groupId>
  <artifactId>A</artifactId>
  <packaging>pom</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>Maven Webapp</name>
  <!--url>http://maven.apache.org</url-->

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



  <dependencies>
    <dependency>
      <groupId>com.oracle</groupId>
      <artifactId>ojdbc5</artifactId>
      <version>11.2.0.1</version>
    </dependency>
  </dependencies>

  <modules>
    <module>subModule1</module>
    <module>subModule2</module>
  </modules>
</project>

subModule1 ist pom.xml

HTML:

<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.a</groupId>
  <artifactId>a</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Maven Webapp</name>

  <distributionManagement>
    <repository>
      <id>releases</id>
      <!-- CHANGE HERE by your team nexus server -->
      <url>http://localhost:8081/nexus/content/repositories/thirdparty/</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <!-- CHANGE HERE by your team nexus server -->
      <url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>


  <dependencies>

    //dependecies are defined here
  <dependencies>

In subModule1 und subModule2 ich habe die distributionManagement Abschnitt.

Aber wenn ich Baue mein Projekt bekomme ich die folgende Fehlermeldung.

[ERROR] Failed to execute goal-Projekt submodule1: Konnte nicht
Abhängigkeiten für das Projekt submodule1:Krieg:1.0-SNAPSHOT: Fehler
zu finden, com.oracle:ojdbc5:jar:in 11.2.0.1
https://repo.maven.apache.org/maven2 zwischengespeichert wurde in der lokalen
repository, die Auflösung wird nicht reattempted, bis das update
Intervall der zentralen verstrichen ist oder updates gezwungen -> [1]

Verstehe ich die Fehlermeldung wird verursacht durch die com.oracle:ojdbc5:jar:11.2.0.1jar-Abhängigkeit nicht aufgelöst werden kann.

Aber ich bin überrascht, warum es ist nicht Kommissionierung es von meinem lokalen nexus-repository.

Habe ich verpasst-Konfiguration, oder mache ich es falsch?

Wie verwende ich den lokalen nexus-repository für mein Vorhaben?

InformationsquelleAutor Varun | 2016-08-11
Schreibe einen Kommentar