- Apache License, Version 2.0
+ Apache-2.0
https://www.apache.org/licenses/LICENSE-2.0.txt
repo
@@ -47,67 +47,27 @@
UTF-8
UTF-8
-
- 2.6.4
- 3.2.2
- 1.0.2
- 1.18.30
-
-
-
- central
- https://repo.maven.apache.org/maven2
-
- false
-
-
-
-
org.openrewrite.recipe
rewrite-recipe-bom
- ${org.openrewrite.recipe.version}
+ 2.9.0
pom
import
org.springframework.boot
spring-boot-dependencies
- ${org.springframework.boot.version}
+ 3.2.2
pom
import
-
-
-
- central
- https://repo.maven.apache.org/maven2
-
- false
-
-
-
-
-
-
- ossrh
- https://s01.oss.sonatype.org/content/repositories/snapshots
-
-
- ossrh
- https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
org.openrewrite
@@ -120,7 +80,7 @@
org.projectlombok
lombok
- ${lombok.version}
+ 1.18.32
provided
@@ -133,7 +93,7 @@
software.xdev
spring-data-eclipse-store
- ${software.xdev.spring.data.eclipse.store.version}
+ 1.0.2
runtime
@@ -154,11 +114,25 @@
+
+
+
+ org.apache.maven.plugins
+ maven-site-plugin
+ 4.0.0-M16
+
+
+ org.apache.maven.plugins
+ maven-project-info-reports-plugin
+ 3.9.0
+
+
+
com.mycila
license-maven-plugin
- 4.3
+ 5.0.0
${project.organization.url}
@@ -187,7 +161,7 @@
org.apache.maven.plugins
maven-compiler-plugin
- 3.12.1
+ 3.14.0
${maven.compiler.release}
@@ -195,11 +169,11 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.6.3
+ 3.11.2
attach-javadocs
- verify
+ package
jar
@@ -213,11 +187,11 @@
org.apache.maven.plugins
maven-source-plugin
- 3.3.0
+ 3.3.1
attach-sources
- verify
+ package
jar-no-fork
@@ -227,19 +201,36 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.5.3
- ossrh
+ publish-sonatype-central-portal
+
+ org.codehaus.mojo
+ flatten-maven-plugin
+ 1.7.0
+
+ ossrh
+
+
+
+ flatten
+ process-resources
+
+ flatten
+
+
+
+
org.apache.maven.plugins
maven-gpg-plugin
- 3.1.0
+ 3.2.7
sign-artifacts
@@ -260,16 +251,13 @@
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.13
+ org.sonatype.central
+ central-publishing-maven-plugin
+ 0.7.0
true
- ossrh
- https://s01.oss.sonatype.org/
-
- 30
- true
+ sonatype-central-portal
+ true
@@ -282,16 +270,17 @@
org.apache.maven.plugins
maven-checkstyle-plugin
- 3.3.1
+ 3.6.0
com.puppycrawl.tools
checkstyle
- 10.13.0
+ 10.23.1
../.config/checkstyle/checkstyle.xml
+ true
@@ -304,5 +293,46 @@
+
+ pmd
+
+
+
+ org.apache.maven.plugins
+ maven-pmd-plugin
+ 3.26.0
+
+ true
+ true
+
+ ../.config/pmd/ruleset.xml
+
+
+
+
+ net.sourceforge.pmd
+ pmd-core
+ 7.13.0
+
+
+ net.sourceforge.pmd
+ pmd-java
+ 7.13.0
+
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jxr-plugin
+ 3.6.0
+
+
+
+
diff --git a/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddAnnotationToOtherAnnotationTest.java b/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddAnnotationToOtherAnnotationTest.java
index 9cbfba6..4ed5c1a 100644
--- a/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddAnnotationToOtherAnnotationTest.java
+++ b/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddAnnotationToOtherAnnotationTest.java
@@ -46,186 +46,174 @@ public void defaults(final RecipeSpec recipeSpec)
@Test
void testSimpleSingle()
{
- this.rewriteRun
- (
- java
- (
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
-
- @SpringBootApplication
- class A
- {
- public A()
- {
- }
- }
- """,
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
-
- @EnableEclipseStoreRepositories
- @SpringBootApplication
- class A
- {
- public A()
- {
- }
- }
- """
- )
- );
+ this.rewriteRun(
+ java(
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+ @SpringBootApplication
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """,
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+ import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
+
+ @EnableEclipseStoreRepositories
+ @SpringBootApplication
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """
+ )
+ );
}
@Test
void testSimpleMultiple()
{
- this.rewriteRun
- (
- java
- (
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
-
- @SpringBootApplication
- class A
- {
- public A()
- {
- }
- }
- """,
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
-
- @EnableEclipseStoreRepositories
- @SpringBootApplication
- class A
- {
- public A()
- {
- }
- }
- """
- ),
- java
- (
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
-
- @SpringBootApplication
- class B
- {
- public B()
- {
- }
- }
- """,
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
-
- @EnableEclipseStoreRepositories
- @SpringBootApplication
- class B
- {
- public B()
- {
- }
- }
- """
- )
- );
+ this.rewriteRun(
+ java(
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+ @SpringBootApplication
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """,
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+ import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
+
+ @EnableEclipseStoreRepositories
+ @SpringBootApplication
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """
+ ),
+ java(
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+ @SpringBootApplication
+ class B
+ {
+ public B()
+ {
+ }
+ }
+ """,
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+ import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
+
+ @EnableEclipseStoreRepositories
+ @SpringBootApplication
+ class B
+ {
+ public B()
+ {
+ }
+ }
+ """
+ )
+ );
}
@Test
void testAlreadyAdded()
{
- this.rewriteRun
- (
- java
- (
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
-
- @EnableEclipseStoreRepositories
- @SpringBootApplication
- class A
- {
- public A()
- {
- }
- }
- """
- )
- );
+ this.rewriteRun(
+ java(
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+ import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
+
+ @EnableEclipseStoreRepositories
+ @SpringBootApplication
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """
+ )
+ );
}
@Test
void testSimpleNoAnnotation()
{
- this.rewriteRun
- (
- java
- (
- """
- class A
- {
- public A()
- {
- }
- }
- """
- )
- );
+ this.rewriteRun(
+ java(
+ """
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """
+ )
+ );
}
@Test
void testSimpleNoAnnotationAndAnnotation()
{
- this.rewriteRun
- (
- java
- (
- """
- class B
- {
- public B()
- {
- }
- }
- """
- ),
- java
- (
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
-
- @SpringBootApplication
- class A
- {
- public A()
- {
- }
- }
- """,
- """
- import org.springframework.boot.autoconfigure.SpringBootApplication;
- import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
-
- @EnableEclipseStoreRepositories
- @SpringBootApplication
- class A
- {
- public A()
- {
- }
- }
- """
- )
- );
+ this.rewriteRun(
+ java(
+ """
+ class B
+ {
+ public B()
+ {
+ }
+ }
+ """
+ ),
+ java(
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+ @SpringBootApplication
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """,
+ """
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
+ import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;
+
+ @EnableEclipseStoreRepositories
+ @SpringBootApplication
+ class A
+ {
+ public A()
+ {
+ }
+ }
+ """
+ )
+ );
}
}
diff --git a/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java b/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java
index 58cbdb1..cf9b8f4 100644
--- a/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java
+++ b/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java
@@ -26,6 +26,7 @@
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
+@SuppressWarnings("checkstyle:LineLength")
class AddSpringPropertyIfClassExistsTest implements RewriteTest
{
@@ -47,103 +48,97 @@ public void defaults(final RecipeSpec recipeSpec)
@Test
void testSimpleProperties()
{
- this.rewriteRun
- (
- properties(
- "",
- """
- spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """,
- s -> s.path("application.properties")
- )
- );
+ this.rewriteRun(
+ properties(
+ "",
+ """
+ spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ """,
+ s -> s.path("application.properties")
+ )
+ );
}
@Test
void testSimpleYaml()
{
- this.rewriteRun
- (
- yaml(
- "",
- """
- spring:
- autoconfigure:
- exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """,
- s -> s.path("application.yml")
- )
- );
+ this.rewriteRun(
+ yaml(
+ "",
+ """
+ spring:
+ autoconfigure:
+ exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ """,
+ s -> s.path("application.yml")
+ )
+ );
}
@Test
void testMultipleYamlAlsoInTestFolder()
{
- this.rewriteRun
- (
- yaml(
- "",
- """
- spring:
- autoconfigure:
- exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """,
- s -> s.path("/src/main/resources/application.yml")
- ),
- yaml(
- "",
- """
- spring:
- autoconfigure:
- exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """,
- s -> s.path("/src/test/resources/application.yml")
- ),
- yaml(
- "",
- """
- spring:
- autoconfigure:
- exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """,
- s -> s.path("application.yml")
- ),
- yaml(
- "",
- s -> s.path("no-application.yml")
- )
- );
+ this.rewriteRun(
+ yaml(
+ "",
+ """
+ spring:
+ autoconfigure:
+ exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ """,
+ s -> s.path("/src/main/resources/application.yml")
+ ),
+ yaml(
+ "",
+ """
+ spring:
+ autoconfigure:
+ exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ """,
+ s -> s.path("/src/test/resources/application.yml")
+ ),
+ yaml(
+ "",
+ """
+ spring:
+ autoconfigure:
+ exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ """,
+ s -> s.path("application.yml")
+ ),
+ yaml(
+ "",
+ s -> s.path("no-application.yml")
+ )
+ );
}
@Test
void testWrongFileNameYaml()
{
- this.rewriteRun
- (
- yaml(
- "",
- s -> s.path("random.yml")
- )
- );
+ this.rewriteRun(
+ yaml(
+ "",
+ s -> s.path("random.yml")
+ )
+ );
}
@Test
void testWrongFileNameProperties()
{
- this.rewriteRun
- (
- properties(
- "",
- s -> s.path("random.properties")
- )
- );
+ this.rewriteRun(
+ properties(
+ "",
+ s -> s.path("random.properties")
+ )
+ );
}
/**
* It's not clear if this is a desired behavior, but since the Open Rewrite Recipe
* {@link org.openrewrite.java.spring.AddSpringProperty} is doing this, and we are only using this recipe, this is
- * how it
- * works now.
+ * how it works now.
*
* Might change in the future.
*
@@ -151,56 +146,53 @@ void testWrongFileNameProperties()
@Test
void testMultipleProperties()
{
- this.rewriteRun
- (
- properties(
- "",
- """
- spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """,
- s -> s.path("application.properties")
- ),
- yaml(
- "",
- """
- spring:
- autoconfigure:
- exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """,
- s -> s.path("application.yml")
- )
- );
+ this.rewriteRun(
+ properties(
+ "",
+ """
+ spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ """,
+ s -> s.path("application.properties")
+ ),
+ yaml(
+ "",
+ """
+ spring:
+ autoconfigure:
+ exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ """,
+ s -> s.path("application.yml")
+ )
+ );
}
@Test
void testExisting()
{
- this.rewriteRun
- (
- properties(
+ this.rewriteRun(
+ properties(
+ """
+ spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
"""
- spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
- """
- )
- );
+ )
+ );
}
@Test
void testClassNotExisting()
{
- this.rewriteRun
- (
- recipeSpec ->
- recipeSpec.recipe(new AddSpringPropertyIfClassExists(
- "not.existing.Class",
- "spring.autoconfigure.exclude",
- "DummyValue",
- "",
- null)),
- properties(
+ this.rewriteRun(
+ recipeSpec ->
+ recipeSpec.recipe(new AddSpringPropertyIfClassExists(
+ "not.existing.Class",
+ "spring.autoconfigure.exclude",
+ "DummyValue",
"",
- s -> s.path("application.properties")
- )
- );
+ null)),
+ properties(
+ "",
+ s -> s.path("application.properties")
+ )
+ );
}
}