Skip to content

Commit

Permalink
Add recipe to change relocated mysql dep in 2.6 migration (#448)
Browse files Browse the repository at this point in the history
* Add recipe to change relocated mysql dep in 2.5 migration

* Change MySQL in 2.6, as that's when dependency management changed

---------

Co-authored-by: Tim te Beek <[email protected]>
  • Loading branch information
fabapp2 and timtebeek authored Nov 21, 2023
1 parent b3bc34d commit 45c7637
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
9 changes: 9 additions & 0 deletions src/main/resources/META-INF/rewrite/spring-boot-26.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ recipeList:
- org.openrewrite.gradle.plugins.UpgradePluginVersion:
pluginIdPattern: org.springframework.boot
newVersion: 2.6.x

# From 2.6 onwards the managed dependency is com.mysql:mysql-connector-j:8.0.33
- org.openrewrite.java.dependencies.ChangeDependency:
oldGroupId: mysql
newGroupId: com.mysql
oldArtifactId: mysql-connector-java
newArtifactId: mysql-connector-j
newVersion: 8.0.x

# Update properties
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_6

Expand Down
11 changes: 0 additions & 11 deletions src/main/resources/META-INF/rewrite/spring-boot-27.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ recipeList:
artifactId: "*"
newVersion: 2.7.x
overrideManagedVersion: false
retainVersions:
- mysql:mysql-connector-java
- org.openrewrite.maven.UpgradeParentVersion:
groupId: org.springframework.boot
artifactId: spring-boot-starter-parent
newVersion: 2.7.x
retainVersions:
- mysql:mysql-connector-java
- org.openrewrite.gradle.plugins.UpgradePluginVersion:
pluginIdPattern: org.springframework.boot
newVersion: 2.7.x
Expand All @@ -54,13 +50,6 @@ recipeList:
oldFullyQualifiedTypeName: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy
newFullyQualifiedTypeName: org.hibernate.boot.model.naming.CamelCaseToUnderscoresNamingStrategy
- org.openrewrite.java.spring.boot2.SpringBootProperties_2_7
# Switch MySQL driver artifactId
- org.openrewrite.java.dependencies.ChangeDependency:
oldGroupId: mysql
oldArtifactId: mysql-connector-java
newGroupId: com.mysql
newArtifactId: mysql-connector-j
newVersion: 8.0.x
# Change: spring.security.saml2.relyingparty.registration.{id}.identityprovider To: spring.security.saml2.relyingparty.registration.{id}.assertingparty
- org.openrewrite.java.spring.boot2.SamlRelyingPartyPropertyApplicationPropertiesMove # Property files.
- org.openrewrite.yaml.ChangeKey: # Yaml files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import static org.openrewrite.maven.Assertions.pomXml;

@Issue("https://github.com/openrewrite/rewrite-spring/issues/274")
public class UpdateMysqlDriverArtifactIdTest implements RewriteTest {
class UpdateMysqlDriverArtifactIdTest implements RewriteTest {

@Override
public void defaults(RecipeSpec spec) {
Expand Down

0 comments on commit 45c7637

Please sign in to comment.