rewrite-maven-plugin icon indicating copy to clipboard operation
rewrite-maven-plugin copied to clipboard

MavenDownloadingExceptions for netty-transport-native-* through artemis-core-client 2.16.0

Open timtebeek opened this issue 3 years ago • 5 comments

Discovered through https://github.com/openrewrite/rewrite/issues/3167 for @magicwerk. Given this minimal pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>magic</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-jms-client</artifactId>
            <version>2.16.0</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.openrewrite.maven</groupId>
                <artifactId>rewrite-maven-plugin</artifactId>
                <version>4.38.2</version>
                <configuration>
                    <activeRecipes>
                        <recipe>com.yourorg.ChangePackageExample</recipe>
                    </activeRecipes>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

When I run mvn rewrite:run. Then I I get MavenDownloadingExceptions

[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:4.38.2:run (default-cli) on project magic: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.38.2:run failed: Failed to download dependencies for pom.xml:
[ERROR] <?xml version="1.0" encoding="UTF-8"?>
[ERROR] <project xmlns="http://maven.apache.org/POM/4.0.0"
[ERROR]          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
[ERROR]          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
[ERROR]     <modelVersion>4.0.0</modelVersion>
[ERROR] 
[ERROR]     <groupId>org.example</groupId>
[ERROR]     <artifactId>magic</artifactId>
[ERROR]     <version>1.0-SNAPSHOT</version>
[ERROR]     <properties>
[ERROR]         <maven.compiler.source>17</maven.compiler.source>
[ERROR]         <maven.compiler.target>17</maven.compiler.target>
[ERROR]         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
[ERROR]     </properties>
[ERROR]     <dependencies>
[ERROR]         <!--~~(io.netty:netty-transport-native-epoll failed. No version provided)~~>--><!--~~(io.netty:netty-transport-native-kqueue failed. No version provided)~~>--><dependency>
[ERROR]             <groupId>org.apache.activemq</groupId>
[ERROR]             <artifactId>artemis-jms-client</artifactId>
[ERROR]             <version>2.16.0</version>
[ERROR]         </dependency>
[ERROR]     </dependencies>
[ERROR]     <build>
[ERROR]         <plugins>
[ERROR]             <plugin>
[ERROR]                 <groupId>org.openrewrite.maven</groupId>
[ERROR]                 <artifactId>rewrite-maven-plugin</artifactId>
[ERROR]                 <version>4.38.2</version>
[ERROR]                 <configuration>
[ERROR]                     <activeRecipes>
[ERROR]                         <recipe>com.yourorg.ChangePackageExample</recipe>
[ERROR]                     </activeRecipes>
[ERROR]                 </configuration>
[ERROR]             </plugin>
[ERROR]         </plugins>
[ERROR]     </build>
[ERROR] </project>: MavenDownloadingExceptions

Both dependencies netty-transport-native-epoll and netty-transport-native-kqueue are declared in artemis-core-client-2.16.0.pom as

<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-transport-native-epoll</artifactId>
  <classifier>${netty-transport-native-epoll-classifier}</classifier>
</dependency>
<dependency>
  <groupId>io.netty</groupId>
  <artifactId>netty-transport-native-kqueue</artifactId>
  <classifier>${netty-transport-native-kqueue-classifier}</classifier>
</dependency>

With the classifiers defined in artemis-pom-2.16.0.pom as

<netty-transport-native-epoll-classifier>linux-x86_64</netty-transport-native-epoll-classifier>
<netty-transport-native-kqueue-classifier>osx-x86_64</netty-transport-native-kqueue-classifier>

There might be something going on with how we resolve those classifiers, but that needs to be explored.

timtebeek avatar Jan 18 '23 15:01 timtebeek

Just tried this one again; no improvement yet with Rewrite Maven plugin 4.39.0.

timtebeek avatar Jan 23 '23 19:01 timtebeek

  • Similar to openrewrite/rewrite-maven-plugin#522 ; re-evaluate once that is closed.

timtebeek avatar Mar 13 '23 09:03 timtebeek

@timtebeek Can you reevaluate this using org.openrewrite.maven:rewrite-maven-plugin:4.43.0-SNAPSHOT?

knutwannheden avatar Mar 20 '23 08:03 knutwannheden

Tried just now; the markers do not appear in the source file (👍🏻), but the download error stays the same (👎🏻).

timtebeek avatar Mar 20 '23 08:03 timtebeek

I haven't look into this one in detail, but let's keep it open then.

knutwannheden avatar Mar 20 '23 08:03 knutwannheden