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

init goal no longer available #620

Closed
jdelobel opened this issue Aug 22, 2023 · 2 comments
Closed

init goal no longer available #620

jdelobel opened this issue Aug 22, 2023 · 2 comments
Labels
bug Something isn't working question Further information is requested

Comments

@jdelobel
Copy link

Hi,

Before, with the maven plugin, i use the init goal that add programmatically the plugin in my existing project's pom

v5.2.6...v5.4.1#diff-fc4bf45cce52d87b08e87c74ad12ec6d162411854ee84c96c19bbf02954c0342L26

Since the init goal no longer exists, how i can do that now?

@jdelobel jdelobel added the bug Something isn't working label Aug 22, 2023
@jdelobel jdelobel changed the title init command no longer available init goal no longer available Aug 22, 2023
@timtebeek
Copy link
Contributor

Hi @jdelobel ; we dropped the init and configure goals in #607, in an effort to reduce the maintenance burden on the plugin while we revisit how the plugin interacts with projects. Those goals were originally added after a request for those in #245, but as of #445 there's less of a need to add the plugin to projects, as you can run the OpenRewrite Maven plugin without updating your pom.xml file.

As an example; here's how you can run the plugin without updating your pom.xml file to upgrade to Spring Boot 3.1, as taken from the docs.

mvn -U org.openrewrite.maven:rewrite-maven-plugin:run \
  -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-spring:RELEASE \
  -Drewrite.activeRecipes=org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1

This will resolve any transitive dependencies as well. The full documentation for rewrite:run is available.

If you'd still want something that keeps the same flow as the init goal before, you can add a custom rewrite.yml file that uses

You can then invoke the Maven plugin as seen above, and reference your custom recipe in rewrite.yml to achieve the same goal of adding the plugin to your project, with optional dependencies.

I hope that provides you with two good options to replace the former init goal. Let us know if you'd need any other help transitioning to either of these options, or if there's anything you can't accomplish now.

@timtebeek timtebeek added the question Further information is requested label Aug 22, 2023
@timtebeek
Copy link
Contributor

Closing due to inactivity; the reason for removal is described above, with multiple alternatives listed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
Archived in project
Development

No branches or pull requests

2 participants