From 935247e18e79527e58638250fe0cba15174d6636 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 9 Sep 2024 12:25:09 +0200 Subject: [PATCH] Reduce warnings when building rewrite-maven-plugin --- .sdkmanrc | 2 +- pom.xml | 16 ++++++++++++++++ .../openrewrite/maven/AbstractRewriteMojo.java | 8 ++++---- .../org/openrewrite/maven/RewriteDryRunIT.java | 2 +- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.sdkmanrc b/.sdkmanrc index f3b37566..b9fe931c 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1,3 +1,3 @@ # Enable auto-env through the sdkman_auto_env config # Add key=value pairs of SDKs to use below -java=17.0.9-tem +java=17.0.12-tem diff --git a/pom.xml b/pom.xml index a15e5cce..430b0704 100644 --- a/pom.xml +++ b/pom.xml @@ -138,6 +138,22 @@ import pom + + + org.apache.maven + maven-api-meta + provided + + + org.apache.maven + maven-api-xml + provided + + + org.apache.maven + maven-xml-impl + provided + diff --git a/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java b/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java index 1429faf4..bedbcdcb 100644 --- a/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java +++ b/src/main/java/org/openrewrite/maven/AbstractRewriteMojo.java @@ -16,7 +16,6 @@ package org.openrewrite.maven; import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.annotations.Component; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; import org.apache.maven.rtinfo.RuntimeInformation; @@ -32,6 +31,7 @@ import org.openrewrite.ipc.http.HttpSender; import org.openrewrite.ipc.http.HttpUrlConnectionSender; +import javax.inject.Inject; import java.io.File; import java.io.IOException; import java.io.InputStream; @@ -50,13 +50,13 @@ public abstract class AbstractRewriteMojo extends ConfigurableRewriteMojo { @Parameter(property = "rewrite.resolvePropertiesInYaml", defaultValue = "true") protected boolean resolvePropertiesInYaml; - @Component + @Inject protected RuntimeInformation runtime; - @Component + @Inject protected SettingsDecrypter settingsDecrypter; - @Component + @Inject protected RepositorySystem repositorySystem; protected Environment environment() throws MojoExecutionException { diff --git a/src/test/java/org/openrewrite/maven/RewriteDryRunIT.java b/src/test/java/org/openrewrite/maven/RewriteDryRunIT.java index 98430ed2..d7420975 100644 --- a/src/test/java/org/openrewrite/maven/RewriteDryRunIT.java +++ b/src/test/java/org/openrewrite/maven/RewriteDryRunIT.java @@ -23,7 +23,7 @@ @MavenJupiterExtension @MavenOption(MavenCLIOptions.NO_TRANSFER_PROGRESS) @MavenOption(MavenCLIExtra.MUTE_PLUGIN_VALIDATION_WARNING) -@MavenOption(MavenCLIOptions.DEBUG) +@MavenOption(MavenCLIOptions.VERBOSE) @MavenGoal("${project.groupId}:${project.artifactId}:${project.version}:dryRun") class RewriteDryRunIT {