Closed rdifrango closed 1 year ago
I'm still running into this with 4.31.3
thus I have to add -DskipMavenParsing=true
to have any of the Java or Logging recipes run.
@rdifrango Do you have a pom.xml or a sample project that can reproduce this problem?
Short of that, a stack trace would also be of great help.
Thanks!
Unfortunately, its a large multi-module project I'm working with, but the one thing that it has that none of the other project teams I'm working has is that it's using flatten-maven-plugin
so perhaps that's causing issues, here's the plug-in configuration
<flatten-maven-plugin.version>1.1.0</flatten-maven-plugin.version>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>${flatten-maven-plugin.version}</version>
<configuration>
<updatePomFile>true</updatePomFile>
<flattenMode>bom</flattenMode>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
and as an FYI...for this project I have to continuously disable Maven POM parsing to get it to work. Now I do know plugin and plugin management in it is a bit all over the place so I'm working to fix that but I'd also argue it should be supported.
@rdifrango Can you try this now with the latest 4.32.0
version?
I believe this was fixed as part of this work:
https://github.com/openrewrite/rewrite/commit/92a5be3ffe06cd66099c336b232416fd93a78e49
unfortunately the problem seems to persist:
[ERROR] Failed to execute goal org.openrewrite.maven:rewrite-maven-plugin:4.32.0:run (default-cli) on project dp-vault-ecc: Execution default-cli of goal org.openrewrite.maven:rewrite-maven-plugin:4.32.0:run failed: Illegal character in path at index 72: file:///Users/a683481/.m2/repository/org/apache/maven/maven-plugin-api/${project.prerequisites.maven}/maven-plugin-api-${project.prerequisites.maven}.pom -> [Help 1]
and my rewrite config:
<rewrite-logging-frameworks.version>1.10.1</rewrite-logging-frameworks.version>
<rewrite-maven-plugin.version>4.32.0</rewrite-maven-plugin.version>
<rewrite-migrate-java.version>1.9.1</rewrite-migrate-java.version>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>${rewrite-maven-plugin.version}</version>
<configuration>
<activeRecipes>
<!-- Converts from log4j to slf4j -->
<recipe>org.openrewrite.java.logging.slf4j.Log4jToSlf4j</recipe>
<recipe>org.openrewrite.java.logging.slf4j.Log4j1ToSlf4j1</recipe>
<recipe>org.openrewrite.java.logging.slf4j.Log4j2ToSlf4j1</recipe>
<!-- These recipes ensure proper log formatting. -->
<recipe>org.openrewrite.java.logging.slf4j.ParameterizedLogging</recipe>
<recipe>org.openrewrite.java.logging.slf4j.Slf4jLogShouldBeConstant</recipe>
<recipe>org.openrewrite.java.logging.slf4j.ConvertLogMessageMessageOnlyToLogMessageAndThrowable</recipe>
<recipe>org.openrewrite.java.logging.PrintStackTraceToLogError</recipe>
</activeRecipes>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-logging-frameworks</artifactId>
<version>${rewrite-logging-frameworks.version}</version>
</dependency>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-migrate-java</artifactId>
<version>${rewrite-migrate-java.version}</version>
</dependency>
</dependencies>
</plugin>
@rdifrango I was just looking through our backlog and came across this issue. Does your maven pom.xml file include the <prerequisites>
tag?
I think this just may be a case where we should be generating an implicit property based on if this tag exists. (Currently, rewrite' maven model is does not include prerequisites)
Closing due to inactivity. Feel free to reopen if the problem persists with the latest versions.
I'm trying to use
org.openrewrite.maven.AddPlugin
and I'm getting the following failure:Here's the rewrite.yml: