openrewrite / rewrite-docs

Stores the markdown documents used to generate docs.openrewrite.org
https://docs.openrewrite.org
Apache License 2.0
40 stars 43 forks source link

change group id and artifact id for gradle ? #262

Closed Sanskarbajaj closed 7 months ago

Sanskarbajaj commented 7 months ago

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

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

timtebeek commented 7 months ago

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.

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:

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 commented 7 months ago

Thanks @timtebeek :)

Sanskarbajaj commented 7 months ago

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

timtebeek commented 7 months ago

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.