Uploaded image for project: 'Red Hat Decision Manager'
  1. Red Hat Decision Manager
  2. RHDM-1283

Maven build using offline repository fails with dependency error in offline environment.

    XMLWordPrintable

Details

    • CR2
    • CR1
    • +
    • Hide

      1. Before starting.

      • Setup maven repository cache.
        $ cd ~/.m2
        $ mv repository repository.bak
        $ mv settings.xml settings.xml.bak
        $ cp settings.xml ~/.m2    # Use settings.xml in Attachments.
        
      • Extract rhdm7-helloworld in Attachments.
        $ cd /workdir
        $ unzip rhdm7-helloworld.zip
        

      2. Create offline repository.

      • Download and use offliner-1.7.jar of [2].
      • Create offline repository by following Procedure 1. and 2. in [1].
        $ mkdir -p /workdir/offline/repository
        $ java -jar offliner-1.7.jar -r https://maven.repository.redhat.com/ga/ -r https://repo1.maven.org/maven2/ -d /workdir/offline/repository rhdm-7.6.0-offliner.txt
        
        $ cd /workdir/rhdm7-helloworld
        $ mvn clean install
        
        $ mvn -e -DskipTests dependency:go-offline -f /workdir/rhdm7-helloworld/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true
        
        $ cd /workdir/offline
        $ (cd ~/.m2; tar cf - repository) | tar xvf -
        $ mv ~/.m2/repository ~/.m2/repository.bak2
        

      3. Use /workdir/offline/repository as your offline repository.

      • Modify ~/.m2/settings.xml.
        (from)
          <activeProfiles>
            <!-- offline repository -->
            <!-- <activeProfile>offline-repository</activeProfile> -->
        
            <!-- online repository -->
            <activeProfile>jboss-enterprise-maven-repository</activeProfile>
            <activeProfile>maven-central-repository</activeProfile>
          </activeProfiles>
        

        (to)

          <activeProfiles>
            <!-- offline repository -->
            <activeProfile>offline-repository</activeProfile>
        
            <!-- online repository -->
            <!-- <activeProfile>jboss-enterprise-maven-repository</activeProfile> -->
            <!-- <activeProfile>maven-central-repository</activeProfile> -->
          </activeProfiles>
        

      4. Build rhdm7-helloworld under offline environment.

      • Turn off your network environment.
      • Build rhdm7-helloworld.
        $ cd /workdir/rhdm7-helloworld
        $ mvn clean install
        

        --> The following dependency error occurs.

        [ERROR] Failed to execute goal on project rhdm7-helloworld: Could not resolve dependencies for project com.example:rhdm7-helloworld:war:0.0.1: Failed to collect dependencies at org.kie:kie-ci:jar:7.30.0.Final-redhat-00003 -> org.kie.soup:kie-soup-maven-integration:jar:7.30.0.Final-redhat-00003 -> org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.2.redhat-00002 -> org.codehaus.plexus:plexus-utils:jar:3.0.17.redhat-00001: Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:3.0.17.redhat-00001: Could not transfer artifact org.codehaus.plexus:plexus-utils:pom:3.0.17.redhat-00001 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.17.redhat-00001/plexus-utils-3.0.17.redhat-00001.pom: Unknown host repo.maven.apache.org: Name or service not known -> [Help 1]
        

      Possible Workaround:

      • Modify /workdir/offline/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.2.redhat-00002/org.eclipse.sisu.plexus-0.3.2.redhat-00002.pom .
        (from)
            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.17.redhat-00001</version>
            </dependency>
        

        (to)

            <dependency>
              <groupId>org.codehaus.plexus</groupId>
              <artifactId>plexus-utils</artifactId>
              <version>3.0.22</version>
            </dependency>
        

      [1] Red Hat Decision Manager > 7.6 > Installing and configuring Red Hat Decision Manager on Red Hat JBoss EAP 7.2 > Chapter 12. Maven settings and repositories for Red Hat Decision Manager - 12.3. Preparing a Maven mirror repository for offline use
      https://access.redhat.com/documentation/en-us/red_hat_decision_manager/7.6/html/installing_and_configuring_red_hat_decision_manager_on_red_hat_jboss_eap_7.2/maven-repo-using-con#offline-repo-proc

      [2] Offliner tool 1.7
      https://repo.maven.apache.org/maven2/com/redhat/red/offliner/offliner/1.7/offliner-1.7.jar

      Show
      1. Before starting. Setup maven repository cache. $ cd ~/.m2 $ mv repository repository.bak $ mv settings.xml settings.xml.bak $ cp settings.xml ~/.m2 # Use settings.xml in Attachments. Extract rhdm7-helloworld in Attachments. $ cd /workdir $ unzip rhdm7-helloworld.zip 2. Create offline repository. Download and use offliner-1.7.jar of [2]. Create offline repository by following Procedure 1. and 2. in [1]. $ mkdir -p /workdir/offline/repository $ java -jar offliner-1.7.jar -r https://maven.repository.redhat.com/ga/ -r https://repo1.maven.org/maven2/ -d /workdir/offline/repository rhdm-7.6.0-offliner.txt $ cd /workdir/rhdm7-helloworld $ mvn clean install $ mvn -e -DskipTests dependency:go-offline -f /workdir/rhdm7-helloworld/pom.xml --batch-mode -Djava.net.preferIPv4Stack=true $ cd /workdir/offline $ (cd ~/.m2; tar cf - repository) | tar xvf - $ mv ~/.m2/repository ~/.m2/repository.bak2 3. Use /workdir/offline/repository as your offline repository. Modify ~/.m2/settings.xml. (from) <activeProfiles> <!-- offline repository --> <!-- <activeProfile>offline-repository</activeProfile> --> <!-- online repository --> <activeProfile>jboss-enterprise-maven-repository</activeProfile> <activeProfile>maven-central-repository</activeProfile> </activeProfiles> (to) <activeProfiles> <!-- offline repository --> <activeProfile>offline-repository</activeProfile> <!-- online repository --> <!-- <activeProfile>jboss-enterprise-maven-repository</activeProfile> --> <!-- <activeProfile>maven-central-repository</activeProfile> --> </activeProfiles> 4. Build rhdm7-helloworld under offline environment. Turn off your network environment. Build rhdm7-helloworld. $ cd /workdir/rhdm7-helloworld $ mvn clean install --> The following dependency error occurs. [ERROR] Failed to execute goal on project rhdm7-helloworld: Could not resolve dependencies for project com.example:rhdm7-helloworld:war:0.0.1: Failed to collect dependencies at org.kie:kie-ci:jar:7.30.0.Final-redhat-00003 -> org.kie.soup:kie-soup-maven-integration:jar:7.30.0.Final-redhat-00003 -> org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.2.redhat-00002 -> org.codehaus.plexus:plexus-utils:jar:3.0.17.redhat-00001: Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:3.0.17.redhat-00001: Could not transfer artifact org.codehaus.plexus:plexus-utils:pom:3.0.17.redhat-00001 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.17.redhat-00001/plexus-utils-3.0.17.redhat-00001.pom: Unknown host repo.maven.apache.org: Name or service not known -> [Help 1] Possible Workaround: Modify /workdir/offline/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.2.redhat-00002/org.eclipse.sisu.plexus-0.3.2.redhat-00002.pom . (from) <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> <version>3.0.17.redhat-00001</version> </dependency> (to) <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> <version>3.0.22</version> </dependency> [1] Red Hat Decision Manager > 7.6 > Installing and configuring Red Hat Decision Manager on Red Hat JBoss EAP 7.2 > Chapter 12. Maven settings and repositories for Red Hat Decision Manager - 12.3. Preparing a Maven mirror repository for offline use https://access.redhat.com/documentation/en-us/red_hat_decision_manager/7.6/html/installing_and_configuring_red_hat_decision_manager_on_red_hat_jboss_eap_7.2/maven-repo-using-con#offline-repo-proc [2] Offliner tool 1.7 https://repo.maven.apache.org/maven2/com/redhat/red/offliner/offliner/1.7/offliner-1.7.jar
    • 2020 Week 31-33 (from Jul 27)

    Description

      Maven build using an offline repository created by following the Installation and Configuration document of RHDM 7.6 [1] in offline environment fails
      with the dependency error message below:

      [ERROR] Failed to execute goal on project rhdm7-helloworld: Could not resolve dependencies for project com.example:rhdm7-helloworld:war:0.0.1: Failed to collect dependencies at org.kie:kie-ci:jar:7.30.0.Final-redhat-00003 -> org.kie.soup:kie-soup-maven-integration:jar:7.30.0.Final-redhat-00003 -> org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.2.redhat-00002 -> org.codehaus.plexus:plexus-utils:jar:3.0.17.redhat-00001: Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:3.0.17.redhat-00001: Could not transfer artifact org.codehaus.plexus:plexus-utils:pom:3.0.17.redhat-00001 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/3.0.17.redhat-00001/plexus-utils-3.0.17.redhat-00001.pom: Unknown host repo.maven.apache.org: Name or service not known -> [Help 1]
      

      Attachments

        1. deptree_verbose.txt
          30 kB
        2. pom.xml_1
          2 kB
        3. pom.xml_2
          2 kB
        4. rhdm7-helloworld.zip
          3 kB
        5. settings.xml
          3 kB
        6. test_20200421a.zip
          26 kB
        7. test_20200421b.zip
          18 kB

        Issue Links

          Activity

            People

              ant@redhat.com Ant Stephenson
              rhn-support-myoshida Masato Yoshida
              Marek Winkler Marek Winkler (Inactive)
              Marek Winkler Marek Winkler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: