Skip to content

Commit

Permalink
Revamp/fix autoconfiguration (#938)
Browse files Browse the repository at this point in the history
* Remove version not required

* Modified hierarchy of modules

* Fix compile errors

* sbm-core

* Copied modules and fixed some compile errors

* Add module sbm-recipes-boot-upgrade

* Fix compile errors, needs revisit

* Fix compile errors, needs revisit

* Fix compile errors, needs revisit

* Fix compile errors, needs revisit

* Add module sbm-support-jee and cleanup others

* All modules compile

* Add module sbm-recipes-jee-to-boot

* Fixed some compile errors

* Fix compile errors

* Merged with main

* Copied modules and fixed some compile errors

* Add module sbm-recipes-boot-upgrade

* Fix compile errors, needs revisit

* Fix compile errors, needs revisit

* Fix compile errors, needs revisit

* Fix compile errors, needs revisit

* Add module sbm-support-jee and cleanup others

* All modules compile

* Add module sbm-recipes-jee-to-boot

* wip sbm-core

* Update license headeres

* sbm-core compiles

* Removed sbm-utils which is now in sbm-support-rewrite

* Removed rework dir

* Update year in license-check plugin

* Fixed MavenPasswordDecrypter

* TestProjectContext persists resources

* Bump jakarta to matching version

* MavenArtifactDownloader moved to sbm-support-rewrite

* Adopt OR changes

* Update javax packages and JavaTemplate

* Fix testdata in test which was surfaced by the new parser

* Update year in license-check plugin

* Add dependencies

* Add java version property to test pom

* Add logging

* Bump shrinkwrap version to be compatible with Maven deps

* Fixing stream was closed

* Test fails because parser does not resolve deps

* Change access to expected resources in test

The order of resources as provided to the TestProjectContext is not guaranteed anymore, now that parsed resources are taken from filesystem

* Change test resources from .foo to .properties to access content

With the new parser .txt and foo resources in src/main/resources were represented as Quarks and allowed no (usual) access to their content

* TestProjectContext uses default root (target) to write resources

* Fix compilation errors in testcode

* Fix endless loop

* Change test resources from .txt to .properties to access content

With the new parser .txt and foo resources in src/main/resources were represented as Quarks and allowed no (usual) access to their content

* Expect different error behaviour

* use temp dir as default

* Fix compilation errors in testcode

* Fix compilation errors in testcode

* Fix tests

* [maven-release-plugin] prepare release 0.15.1

* [maven-release-plugin] prepare for next development iteration

* Moved scope package to sbm-support-rewrite

* ScanScope handled in parser

* Fixing ArchUnit condition after moving scoped beans logic

* Moved JavaParserBuilder into sbm-support-rewrite

* Fixed some tests

* Fix maven setup in test

* Fix compile and maven errors in testscode

* Add java version in test pom fixes test

* Fix test

* Fix mock in test

* Add java version in test pom fixes test

* Fix test

* Fix RewriteMigrationResultMerger

* Fix tests and adjust to changes in OR 8.1.2

* format

* Fix test and make modules compile

* Changes from origin

* Add testcode

* Add testcode

* Replace shrinkwrap with OpenRewrite

* Fix typo in version

* Fix parsing duplicate pom files

Added target to default ignorePatterns
Refactor method names for test
Fix dependency download
Fix test by ignoring poms when parsing resources
Add logging
Replace List with Set to avoid duplicates

* Include ScannerConfiguration

* Fix autoconfiguration

* Bump OR to 8.5.1

* Cleaned up pom
  • Loading branch information
fabapp2 authored Sep 20, 2023
1 parent 10409c8 commit a03d015
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 50 deletions.
59 changes: 11 additions & 48 deletions sbm-support-rewrite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-boot.version>3.1.3</spring-boot.version>
<rewrite.version>8.4.2</rewrite.version>
<rewrite.version>8.5.1</rewrite.version>
<rewrite-spring.version>5.0.5</rewrite-spring.version>
<sbm.version>0.15.0-SNAPSHOT</sbm.version>
<rewrite-maven-plugin.version>5.3.2</rewrite-maven-plugin.version>
Expand Down Expand Up @@ -94,6 +94,15 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
Expand Down Expand Up @@ -138,15 +147,6 @@
<artifactId>rewrite-maven-plugin</artifactId>
<version>${rewrite-maven-plugin.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand All @@ -167,21 +167,6 @@
<artifactId>maven-resolver-connector-basic</artifactId>
<version>${maven-resolver.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-resolver-provider</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
Expand All @@ -203,20 +188,11 @@
<artifactId>plexus-cipher</artifactId>
<version>${plexus-cypher.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model-builder</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>${maven-invoker.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
Expand Down Expand Up @@ -434,19 +410,6 @@ limitations under the License.
<localCheckout>true</localCheckout>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
* @author Fabian Krüger
*/
@AutoConfiguration
@Import(DiscoveryConfiguration.class)
@Import({DiscoveryConfiguration.class, ScannerConfiguration.class})
public class SbmSupportRewriteConfiguration {
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.sbm.boot.autoconfigure.ParserPropertiesPostProcessor;
import org.springframework.sbm.boot.autoconfigure.ScannerConfiguration;
import org.springframework.sbm.parsers.events.RewriteParsingEventListenerAdapter;
import org.springframework.sbm.scopes.ProjectMetadata;
import org.springframework.sbm.scopes.ScanScope;
Expand All @@ -47,7 +48,7 @@
* @author Fabian Krüger
*/
@Slf4j
@AutoConfiguration(after = ScopeConfiguration.class)
@AutoConfiguration(after = {ScopeConfiguration.class})
@EnableConfigurationProperties(ParserProperties.class)
@Import({ScanScope.class, ScopeConfiguration.class})
public class RewriteParserConfiguration {
Expand Down

0 comments on commit a03d015

Please sign in to comment.