You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/05/01 20:10:03 UTC

[GitHub] [maven-dependency-plugin] pzygielo opened a new pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

pzygielo opened a new pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46


   I propose this change to resolve [MDEP-680](https://issues.apache.org/jira/browse/MDEP-680).
   
   My understanding is as follows:
   1. both `o.a.m...internal.Maven30DependencyResolver.resolveDependencies` and `o.a.m...internal.Maven31DependencyResolver.resolveDependencies` use `buildingRequest.getRemoteRepositories()`
   2. `ResolvePluginsMojo` sets them explicitly: https://github.com/apache/maven-dependency-plugin/blob/6adc71cceb0cc8bfc05d0b6d1ff72652d7e39f33/src/main/java/org/apache/maven/plugins/dependency/resolvers/ResolvePluginsMojo.java#L200 but `GoOffline` doesn't. Thus as I observed effectively only central is used.
   
   I recorded my steps of the preparation, actual fix and some clean-up in separate commits.
   
   I'm pretty sure about the code change, as I successfully used new `go-offline` from snapshot plugin with several (multi-module, parent-child) projects with dependencies and plugins from multiple (i.e. non-central) repositories.
   
   
   ---
   
    - [X] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] pzygielo edited a comment on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
pzygielo edited a comment on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-625871051


   > Perhaps this is another separate issue related to `go-offline` changes?
   
   Perhaps it is. You can check [existing ones](https://issues.apache.org/jira/browse/MDEP-690?jql=%20project%20%3D%22Maven%20Dependency%20Plugin%22%20and%20component%20%3Dgo-offline%20) and if none covers your case you can submit new.
   
   But I think it is due to feature [MDEP-204: Transitively resolve both dependencies and plugins](https://issues.apache.org/jira/browse/MDEP-204) delivered in [3.1.2](https://github.com/apache/maven-dependency-plugin/releases/tag/maven-dependency-plugin-3.1.2) that exposes that [io.netty:netty-parent:4.1.49.Final](https://repo.maven.apache.org/maven2/io/netty/netty-parent/4.1.49.Final/netty-parent-4.1.49.Final.pom) (parent of dependency you use) references undefined `os.detected.name` and `os.detected.arch` properties.
   
   Try:
   ```
   mvn dependency:go-offline -Dos.detected.name=linux -Dos.detected.arch=x86_64
   ```
   and you'll get all resolved.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] zzgzy removed a comment on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
zzgzy removed a comment on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-648441977


   @pzygielo Thank you for the reply. Does it mean I need to wait until 3.1.3 to get this new functionality?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] pzygielo commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
pzygielo commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-648441280


   @zzgzy It was merged, but new plugin version ([3.1.3](https://issues.apache.org/jira/projects/MDEP/versions/12347842)) wasn't released yet.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] michael-o commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-636297036


   I will have a look this night, can't promise I can understand the issue or the patch.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] zzgzy commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
zzgzy commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-648441977


   @pzygielo Thank you for the reply. Does it mean I need to wait until 3.1.3 to get this new functionality?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] pzygielo commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
pzygielo commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-636292773


   May I ask for review, please?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] tylerwilding-wk commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
tylerwilding-wk commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-625995050


   > (Or use in your project the same build extension as netty-parent does - kr.motd.maven:os-maven-plugin to set them).
   
   Thank you for this suggestion, that solved the problem.  And then consuming the fixes here via your jitpack release was necessary to resolve our non-maven central dependencies. 👍 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] pzygielo commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
pzygielo commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-625871051


   > Perhaps this is another separate issue related to `go-offline` changes?
   
   Perhaps it is. You can check [existing ones](https://issues.apache.org/jira/browse/MDEP-690?jql=%20project%20%3D%22Maven%20Dependency%20Plugin%22%20and%20component%20%3Dgo-offline%20) and if none covers your case you can submit new.
   
   But I think it is due to feature [MDEP-204](https://issues.apache.org/jira/browse/MDEP-204) delivered in [3.1.2](https://github.com/apache/maven-dependency-plugin/releases/tag/maven-dependency-plugin-3.1.2) that exposes that [io.netty:netty-parent:4.1.49.Final](https://repo.maven.apache.org/maven2/io/netty/netty-parent/4.1.49.Final/netty-parent-4.1.49.Final.pom) (parent of dependency you use) references undefined `os.detected.classifier` property.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] zzgzy commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
zzgzy commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-648435660


   Is this change merged in?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] pzygielo edited a comment on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
pzygielo edited a comment on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-625871051


   > Perhaps this is another separate issue related to `go-offline` changes?
   
   Perhaps it is. You can check [existing ones](https://issues.apache.org/jira/browse/MDEP-690?jql=%20project%20%3D%22Maven%20Dependency%20Plugin%22%20and%20component%20%3Dgo-offline%20) and if none covers your case you can submit new.
   
   But I think it is due to feature [MDEP-204: Transitively resolve both dependencies and plugins](https://issues.apache.org/jira/browse/MDEP-204) delivered in [3.1.2](https://github.com/apache/maven-dependency-plugin/releases/tag/maven-dependency-plugin-3.1.2) that exposes that [io.netty:netty-parent:4.1.49.Final](https://repo.maven.apache.org/maven2/io/netty/netty-parent/4.1.49.Final/netty-parent-4.1.49.Final.pom) (parent of dependency you use) references undefined `os.detected.classifier` property.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] pzygielo commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
pzygielo commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-636333008


   @michael-o thanks for checking.
   Formatting applied, usage of `String.format` removed.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] pzygielo edited a comment on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
pzygielo edited a comment on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-625871051


   > Perhaps this is another separate issue related to `go-offline` changes?
   
   Perhaps it is. You can check [existing ones](https://issues.apache.org/jira/browse/MDEP-690?jql=%20project%20%3D%22Maven%20Dependency%20Plugin%22%20and%20component%20%3Dgo-offline%20) and if none covers your case you can submit new.
   
   But I think it is due to feature [MDEP-204: Transitively resolve both dependencies and plugins](https://issues.apache.org/jira/browse/MDEP-204) delivered in [3.1.2](https://github.com/apache/maven-dependency-plugin/releases/tag/maven-dependency-plugin-3.1.2) that exposes that [io.netty:netty-parent:4.1.49.Final](https://repo.maven.apache.org/maven2/io/netty/netty-parent/4.1.49.Final/netty-parent-4.1.49.Final.pom) (parent of dependency you use) references undefined `os.detected.name` and `os.detected.arch` properties.
   
   Try:
   ```
   mvn dependency:go-offline -Dos.detected.name=linux -Dos.detected.arch=x86_64
   ```
   and you'll get all resolved.
   (Or use in your project the same build extension as netty-parent does - `kr.motd.maven:os-maven-plugin` to set them).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] asfgit closed pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-dependency-plugin] tylerwilding-wk commented on pull request #46: [MDEP-680] Use proper remote repositories to resolve plugins/dependencies

Posted by GitBox <gi...@apache.org>.
tylerwilding-wk commented on pull request #46:
URL: https://github.com/apache/maven-dependency-plugin/pull/46#issuecomment-625832623


   We have also been experiencing problems using `go-offline` since the `3.1.2` release, specifically when trying to resolve `netty`.
   
   Unfortunately when I pulled down these changes and built the plugin locally, I get the same error.  Perhaps this is another separate issue related to `go-offline` changes?
   
   Using a blank pom.xml with only the latest netty dependency and the dependency plugin:
   ```xml
   ...
       <dependencies>
           <dependency>
               <groupId>io.netty</groupId>
               <artifactId>netty-all</artifactId>
               <version>4.1.49.Final</version>
           </dependency>
       </dependencies>
   
       <build>
           <plugins>
               <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-dependency-plugin</artifactId>
                   <version>3.1.2</version>
               </plugin>
           </plugins>
       </build>
   ...
   ```
   
   Using 3.1.2:
   ```
   [INFO] --- maven-dependency-plugin:3.1.2:go-offline (default-cli) @ maven-test ---
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD FAILURE
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  1.340 s
   [INFO] Finished at: 2020-05-08T10:01:59-04:00
   [INFO] ------------------------------------------------------------------------
   [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline (default-cli) on project maven-test: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.30.Final, io.netty:netty-transport-native-kqueue:jar:${os.detected.name}-${os.detected.arch}:4.1.49.Final: Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.30.Final 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]
   ```
   
   Using these changes:
   ```
   INFO] --- maven-dependency-plugin:3.1.3-LOCAL:go-offline (default-cli) @ maven-test ---
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD FAILURE
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  1.602 s
   [INFO] Finished at: 2020-05-08T10:02:33-04:00
   [INFO] ------------------------------------------------------------------------
   [ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.1.3-LOCAL:go-offline (default-cli) on project maven-test: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts could not be resolved: io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.30.Final, io.netty:netty-transport-native-kqueue:jar:${os.detected.name}-${os.detected.arch}:4.1.49.Final: Failure to find io.netty:netty-tcnative:jar:${os.detected.classifier}:2.0.30.Final 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]
   ```
   
   Which builds successfully on 3.1.1:
   ```
   INFO] --- maven-dependency-plugin:3.1.1:go-offline (default-cli) @ maven-test ---
   [INFO] Resolved: netty-all-4.1.49.Final.jar
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time:  1.258 s
   [INFO] Finished at: 2020-05-08T10:04:29-04:00
   [INFO] ------------------------------------------------------------------------
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org