Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ updates:
# Maven plugins
- dependency-name: org.apache.maven.plugins:*
- dependency-name: org.codehaus.mojo:*
- dependency-name: org.openrewrite.maven:rewrite-maven-plugin
- dependency-name: io.fabric8:docker-maven-plugin
- dependency-name: net.revelc.code.formatter:formatter-maven-plugin
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spot is already added only for kotlin but not used.

As spot is covering the impsort-maven-plugin as well, we can have 2 for 1 plugin meaning only spot for having current functionality.

rewrite then goes beyond whitespaces fixing real issues and flaws.

Is this a way to go for the dev team?

This will integrate silent without breaking current workflow, but even fixing any.

@gsmet

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assuming as already in touch

the leal topic (licence) is not involved, right?
or does the plugin usage interfere anything? @timtebeek

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the leal topic (licence) is not involved, right?
or does the plugin usage interfere anything?

I fail to understand what you mean by this comment; can you provide more context when tagging folks?
It's hard to drop in somewhere and then having to parse a whole lot when you want my input on something.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes sorry.

does the licence of rewrite effect on quarkus, when using the plugin?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So up to now, after some friendly coordination late last year, the folks at Quarkus are only using Apache Licensed components of OpenRewrite, such as the rewrite-maven-plugin, rewrite-core/java, rewrite-java-dependencies and of course rewrite-quarkus.

In this PR you look to be adding rewrite-static-analysis in independent-projects/parent/pom.xml as a build plugin. That would still be very much allowed by our licensing terms, but different teams have different tastes for exposure to other-than-traditional OSS licenses, even if it's just a build dependency.

From my earlier chats with the folks at Quarkus/Red Hat I'd say it's likely they'd be appreciative of the code changes made by recipes, but perhaps not willing to make rewrite-static-analysis part of their build pipeline. Any Apache Licensed recipes would not have any such hurdles to clear. I can't speak for them of course; just telling you what I'd expect.

Copy link
Author

@Pankraz76 Pankraz76 Jun 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed exposition.

allowed by our licensing terms

So the licence seems not to be an issue, giving the ability to leverage rewrite-maven-plugin.

Is there an limit to only use rewrite-static-analysis, or could we use all the other goodness, as well?

Like rewrite-testing-frameworks, rewrite-rewrite highlighting bestpractices, as there are several different around.

Treat the plugin as found- and limitation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The licenses for every module are listed here:

The terms for the various licenses are here, with a clear FAQ at the end as well:

In short the folks here (and other end users in general) are welcome to use any of the Apache or MSAL modules for their own code and purposes.

- dependency-name: net.revelc.code:impsort-maven-plugin
Expand Down
128 changes: 128 additions & 0 deletions independent-projects/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<version.plugin.plugin>3.15.1</version.plugin.plugin>
<version.release.plugin>3.1.1</version.release.plugin>
<version.resources.plugin>3.3.1</version.resources.plugin>
<version.rewrite.plugin>6.10.0</version.rewrite.plugin>
<version.rewrite.static.analysis>2.10.0</version.rewrite.static.analysis>
<!-- Do not update for now as it is causing test issues in integration-tests/devmode
java.lang.NoClassDefFoundError: com/salesforce/jprotoc/Generator -->
<version.shade.plugin>3.2.1</version.shade.plugin>
Expand Down Expand Up @@ -361,6 +363,34 @@
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<version>${version.rewrite.plugin}</version>
<configuration>
<activeRecipes>
<recipe>org.openrewrite.staticanalysis.MissingOverrideAnnotation</recipe>
<!-- <recipe>org.openrewrite.staticanalysis.NoToStringOnStringType</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.NoValueOfOnStringType</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedLocalVariables</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateFields</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.RemoveUnusedPrivateMethods</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryCloseInTryWithResources</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryExplicitTypeArguments</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryReturnAsLastStatement</recipe>-->
<!-- <recipe>org.openrewrite.staticanalysis.UnnecessaryThrows</recipe>-->
</activeRecipes>
<failOnDryRunResults>true</failOnDryRunResults>
<rewriteSkip>${format.skip}</rewriteSkip>
</configuration>
<dependencies>
<dependency>
<groupId>org.openrewrite.recipe</groupId>
<artifactId>rewrite-static-analysis</artifactId>
<version>${version.rewrite.static.analysis}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
Expand Down Expand Up @@ -623,5 +653,103 @@
</pluginManagement>
</build>
</profile>
<profile>
<id>format</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>!no-format</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<executions>
<execution>
<id>sort-imports</id>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>validate</id>
<activation>
<activeByDefault>true</activeByDefault>
<property>
<name>no-format</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.openrewrite.maven</groupId>
<artifactId>rewrite-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>dryRun</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<executions>
<execution>
<id>check-imports</id>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>