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

change group id and artifact id for gradle ? #262

Closed
Sanskarbajaj opened this issue Jan 31, 2024 · 4 comments
Closed

change group id and artifact id for gradle ? #262

Sanskarbajaj opened this issue Jan 31, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Sanskarbajaj
Copy link

like for maven we have something like this
org.openrewrite.maven.ChangePluginGroupIdAndArtifactId

what if i want to use for gradle what can i use

@Sanskarbajaj Sanskarbajaj added the enhancement New feature or request label Jan 31, 2024
@timtebeek
Copy link
Contributor

Hi @Sanskarbajaj ; Here's a couple of recipes that might suit your needs; hope that helps.

Gradle

You can see all Gradle recipes through: https://docs.openrewrite.org/recipes/gradle/

Change a Gradle plugin

Changes the selected Gradle plugin to the new plugin.
https://docs.openrewrite.org/recipes/gradle/plugins/changeplugin

Change Gradle dependency

Change a Gradle dependency coordinates. The newGroupId or newArtifactId MUST be different from before.
https://docs.openrewrite.org/recipes/gradle/changedependency

Upgrade Gradle dependency versions

Upgrade the version of a dependency in a build.gradle file. Supports updating dependency declarations of various forms.

  • String notation: "group:artifact:version"
  • Map notation: group: 'group', name: 'artifact', version: 'version' Can update version numbers which are defined earlier in the same file in variable declarations.

https://docs.openrewrite.org/recipes/gradle/upgradedependencyversion

Maven

You can see all Maven recipes through: https://docs.openrewrite.org/recipes/maven/

Change Maven plugin group and artifact ID

Change the groupId and/or the artifactId of a specified Maven plugin.
https://docs.openrewrite.org/recipes/maven/changeplugingroupidandartifactid

Change Maven dependency

Change a Maven dependency coordinates. The newGroupId or newArtifactId MUST be different from before.
https://docs.openrewrite.org/recipes/maven/changedependencygroupidandartifactid

Upgrade Maven dependency version

Upgrade the version of a dependency by specifying a group and (optionally) an artifact using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
https://docs.openrewrite.org/recipes/maven/upgradedependencyversion

Both Gradle and Maven

Note that we also have a selection of recipes for both Maven and Gradle:
https://docs.openrewrite.org/recipes/java/dependencies

Upgrade Gradle or Maven dependency versions

For Gradle projects, upgrade the version of a dependency in a build.gradle file. Supports updating dependency declarations of various forms:

  • String notation: "group:artifact:version"
  • Map notation: group: 'group', name: 'artifact', version: 'version' Can update version numbers which are defined earlier in the same file in variable declarations.

For Maven projects, upgrade the version of a dependency by specifying a group and (optionally) an artifact using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
https://docs.openrewrite.org/recipes/java/dependencies/upgradedependencyversion

@Sanskarbajaj
Copy link
Author

Thanks @timtebeek :)

@Sanskarbajaj
Copy link
Author

Hi @timtebeek could you help me with this
org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId
this is something that we use for maven
whats for gradle?

@timtebeek
Copy link
Contributor

There's no direct replacement for the Maven managed dependency recipe in Gradle (yet). You might want to open issue to describe what you're looking for. Perhaps you'd be interested in adding Gradle dependency constraints for instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants