Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-15908

hadoop-build-tools jar is downloaded from remote repository instead of using from local

VotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.0, 3.2.1
    • build
    • None
    • Reviewed

    Description

      HADOOP-12893 added "maven-remote-resources-plugin" to hadoop-project/pom.xml to verify LICENSE.txt and NOTICE.txt files which includes "hadoop-build-tools" remote resource bundles.

      <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-remote-resources-plugin</artifactId>
       <version>${maven-remote-resources-plugin.version}</version>
       <configuration>
       <resourceBundles>
       <resourceBundle>org.apache.hadoop:hadoop-build-tools:${hadoop.version}</resourceBundle>
       </resourceBundles>
       </configuration>
       <dependencies>
       <dependency>
       <groupId>org.apache.hadoop</groupId>
       <artifactId>hadoop-build-tools</artifactId>
       <version>${hadoop.version}</version>
       </dependency>
       </dependencies>
       <executions>
       <execution>
       <goals>
       <goal>process</goal>
       </goals>
       </execution>
       </executions>
       </plugin>
      

      If we build only some module we always download " hadoop-build-tools" from maven repository.

      For example run:
      cd hadoop-common-project/
      mvn test
      Then we will get the following output:

      [INFO] --- maven-remote-resources-plugin:1.5:process (default) @ hadoop-annotations ---
      Downloading from apache.snapshots: http://repository.apache.org/snapshots/org/apache/hadoop/hadoop-build-tools/3.3.0-SNAPSHOT/maven-metadata.xml
      Downloaded from apache.snapshots: http://repository.apache.org/snapshots/org/apache/hadoop/hadoop-build-tools/3.3.0-SNAPSHOT/maven-metadata.xml (791 B at 684 B/s)
      Downloading from apache.snapshots: http://repository.apache.org/snapshots/org/apache/hadoop/hadoop-main/3.3.0-SNAPSHOT/maven-metadata.xml
      Downloaded from apache.snapshots: http://repository.apache.org/snapshots/org/apache/hadoop/hadoop-main/3.3.0-SNAPSHOT/maven-metadata.xml (609 B at 547 B/s)
      Downloading from apache.snapshots.https: https://repository.apache.org/content/repositories/snapshots/org/apache/hadoop/hadoop-build-tools/3.3.0-SNAPSHOT/maven-metadata.xml
      Downloaded from apache.snapshots.https: https://repository.apache.org/content/repositories/snapshots/org/apache/hadoop/hadoop-build-tools/3.3.0-SNAPSHOT/maven-metadata.xml (791 B at 343 B/s)
      Downloading from apache.snapshots.https: https://repository.apache.org/content/repositories/snapshots/org/apache/hadoop/hadoop-build-tools/3.3.0-SNAPSHOT/hadoop-build-tools-3.3.0-20181022.232020-179.jar
      Downloaded from apache.snapshots.https: https://repository.apache.org/content/repositories/snapshots/org/apache/hadoop/hadoop-build-tools/3.3.0-SNAPSHOT/hadoop-build-tools-3.3.0-20181022.232020-179.jar (0 B at 0 B/s)
      

      If "hadoop-build-tools" jar doesn't exist in maven repository (for example we try to build new version locally before repository will be created ) we can't build some module:
      For example run:
      cd hadoop-common-project/
      mvn test
      Then we will get the following output:

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process (default) on project hadoop-annotations: Execution default of goal org.apache.maven.plugins:maven-remote-resources-plugin:1.5:process failed: Plugin org.apache.maven.plugins:maven-remote-resources-plugin:1.5 or one of its dependencies could not be resolved: Failure to find org.apache.hadoop:hadoop-build-tools:jar:3.2.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
      

      Therefore, we need to limit execution of the Remote Resources Plugin only in the root directory in which the build was run.
      To accomplish this, we can use the "runOnlyAtExecutionRoot parameter"
      From maven documentation http://maven.apache.org/plugins/maven-remote-resources-plugin/usage.html

      Attachments

        1. HADOOP-15908.001.patch
          1 kB
          Oleksandr Shevchenko
        2. HADOOP-15908.002.patch
          2 kB
          Oleksandr Shevchenko

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            oshevchenko Oleksandr Shevchenko
            oshevchenko Oleksandr Shevchenko
            Votes:
            0 Vote for this issue
            Watchers:
            6 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment