You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Oleksandr Shevchenko (JIRA)" <ji...@apache.org> on 2018/11/08 16:49:00 UTC

[jira] [Comment Edited] (HADOOP-15908) hadoop-build-tools jar is downloaded from remote repository instead of using from local

    [ https://issues.apache.org/jira/browse/HADOOP-15908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16680000#comment-16680000 ] 

Oleksandr Shevchenko edited comment on HADOOP-15908 at 11/8/18 4:48 PM:
------------------------------------------------------------------------

I misunderstood functionality of "runOnlyAtExecutionRoot" parameter.

But the approach is the same as before. We need to run "maven-remote-resources-plugin" to add "LICENSE.txt" and "NOTICE.txt" to the jars only when we build the whole project from project root directory.

As far as I see in HADOOP-13297 was added the workaround for project building:
1. Added dependency on hadoop-build-tools
2. hadoop-build-tools pom and jar should be always uploaded to the repository

In this case, we can't build the project (or needed submodule) if hadoop-build-tools doesn't present in the repository.

I have attached the new patch with the following changes:
1. Added "resource-bundle" profile which is activated only when we build the whole project from project root directory (check if LICENSE.txt is present in the current working directory where the build was triggered).
2. Removed dependency on hadoop-build-tools since this is not needed anymore.
3. Moved "configuration" section to the "execution" section just to fit official Maven plugin documentation.

I checked that "LICENSE.txt" and "NOTICE.txt" are present in jars when we build the whole project from project root directory.
{code:java}
jar tf hadoop-common-3.2.0-test.jar | grep LICENSE.txt
META-INF/LICENSE.txt
jar tf hadoop-common-3.2.0-test.jar | grep NOTICE.txt
META-INF/NOTICE.txt
{code}
These files are not present if we build only some submodule or run tests ("maven-remote-resources-plugin" not run).

[~ajisakaa] Could you please review the new patch and evaluate the approach? Please correct me if I missed something.
Thanks!


was (Author: oshevchenko):
I misunderstood functionality of "runOnlyAtExecutionRoot" parameter.

But the approach is the same as before. We need to run "maven-remote-resources-plugin" to add "LICENSE.txt" and "NOTICE.txt" to the jars only when we build the whole project from project root directory.

As far as I see in HADOOP-13297 was added the workaround for project building:
1. Added dependency on hadoop-build-tools
2. hadoop-build-tools pom and jar should be always uploaded to the repository

In this case, we can't build the project (or needed submodule) if hadoop-build-tools doesn't present in the repository.

I have attached the new patch with the following changes:
1. Added "resource-bundle" profile with is activated only when we build the whole project from project root directory (check if LICENSE.txt is present in the current working directory where the build was triggered).
2. Removed dependency on hadoop-build-tools since this is not needed anymore.
3. Moved "configuration" section to the "execution" section just to fit official Maven plugin documentation.

I checked that "LICENSE.txt" and "NOTICE.txt" are present in jars when we build the whole project from project root directory.
{code}
jar tf hadoop-common-3.2.0-test.jar | grep LICENSE.txt
META-INF/LICENSE.txt
jar tf hadoop-common-3.2.0-test.jar | grep NOTICE.txt
META-INF/NOTICE.txt
{code}

These files are not present if we build only some submodule or run tests ("maven-remote-resources-plugin" not run).

[~ajisakaa] Could you please review the new patch and evaluate the approach? Please correct me if I missed something.
Thanks!

> hadoop-build-tools jar is downloaded from remote repository instead of using from local
> ---------------------------------------------------------------------------------------
>
>                 Key: HADOOP-15908
>                 URL: https://issues.apache.org/jira/browse/HADOOP-15908
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Oleksandr Shevchenko
>            Priority: Minor
>         Attachments: HADOOP-15908.001.patch, HADOOP-15908.002.patch
>
>
> 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. 
> {code}
> <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>
> {code}
> 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:
> {noformat}
> [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)
> {noformat}
> 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:
> {noformat}
> [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]
> {noformat}
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org