Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from sources to resolve-sources for the maven-dependency-plugin #20

Open
yeikel opened this issue Jun 21, 2024 · 1 comment
Open
Labels
good first issue Good for newcomers recipe

Comments

@yeikel
Copy link

yeikel commented Jun 21, 2024

What problem are you trying to solve?

What precondition(s) should be checked before applying this recipe?

  • It is a maven project using maven-dependency-plugin >= 3.7.0

Describe the situation before applying the recipe

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>${maven-dependency-plugin.version}</version>
  <executions>
    <execution>
      <goals>
        <goal>sources</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Describe the situation after applying the recipe

diff --git a/pom.xml b/pom.xml
index 6f1d54220..fbee73aba 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1027,7 +1027,7 @@
                     <executions>
                         <execution>
                             <goals>
-                                <goal>sources</goal>
+                                <goal>resolve-sources</goal>
                             </goals>
                         </execution>
                     </executions>

Any additional context

https://issues.apache.org/jira/browse/MDEP-941
https://github.com/apache/maven-dependency-plugin/pull/411/files

@timtebeek timtebeek transferred this issue from openrewrite/rewrite Jun 23, 2024
@timtebeek timtebeek moved this to Recipes Wanted in OpenRewrite Jun 23, 2024
@timtebeek timtebeek added recipe good first issue Good for newcomers labels Jun 23, 2024
@timtebeek
Copy link
Contributor

Thanks for the suggestion @yeikel , and the helpful links out to Jira & the associated PR. I've moved this issue to rewrite-apache, as we might want to shift some of the none-core Maven best practices recipes here.

We can use a precondition to limit this to only apply to projects using that particular range of versions, and then within that replace any goals as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers recipe
Projects
Status: Recipes Wanted
Development

No branches or pull requests

2 participants