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

871 adding dependency should fire an event with all required information to parse affected java sources with the new classpath #881

Draft
wants to merge 93 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
d4c0a7c
Remove version not required
fabapp2 Aug 4, 2023
56d3637
Modified hierarchy of modules
fabapp2 Aug 4, 2023
38860d7
Fix compile errors
fabapp2 Aug 4, 2023
1b7f735
sbm-core
fabapp2 Aug 5, 2023
30937bc
Copied modules and fixed some compile errors
fabapp2 Aug 4, 2023
46043d3
Add module sbm-recipes-boot-upgrade
fabapp2 Aug 4, 2023
351de99
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
a820f31
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
97d95f4
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
58e2dd3
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
089be8b
Add module sbm-support-jee and cleanup others
fabapp2 Aug 4, 2023
0e4a7a0
All modules compile
fabapp2 Aug 4, 2023
fdee582
Add module sbm-recipes-jee-to-boot
fabapp2 Aug 4, 2023
3fb92e7
Fixed some compile errors
fabapp2 Aug 4, 2023
59c2b08
Fix compile errors
fabapp2 Aug 4, 2023
e489696
Merged with main
fabapp2 Aug 4, 2023
76492ca
Copied modules and fixed some compile errors
fabapp2 Aug 4, 2023
b5ae821
Add module sbm-recipes-boot-upgrade
fabapp2 Aug 4, 2023
e3b11b0
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
dae3fb6
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
fd2d107
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
9394658
Fix compile errors, needs revisit
fabapp2 Aug 4, 2023
326c639
Add module sbm-support-jee and cleanup others
fabapp2 Aug 4, 2023
4e5e664
All modules compile
fabapp2 Aug 4, 2023
b579670
Add module sbm-recipes-jee-to-boot
fabapp2 Aug 4, 2023
ed341d8
wip sbm-core
fabapp2 Aug 5, 2023
e40c0da
Update license headeres
fabapp2 Aug 5, 2023
02e69c6
sbm-core compiles
fabapp2 Aug 5, 2023
9de5718
Removed sbm-utils which is now in sbm-support-rewrite
fabapp2 Aug 5, 2023
bea9017
Removed rework dir
fabapp2 Aug 5, 2023
fc3b24d
Update year in license-check plugin
fabapp2 Aug 5, 2023
fed8c38
Fixed MavenPasswordDecrypter
fabapp2 Aug 5, 2023
047a544
TestProjectContext persists resources
fabapp2 Aug 5, 2023
5827716
Bump jakarta to matching version
fabapp2 Aug 5, 2023
912567b
MavenArtifactDownloader moved to sbm-support-rewrite
fabapp2 Aug 5, 2023
3a54457
Adopt OR changes
fabapp2 Aug 6, 2023
e30c02e
Update javax packages and JavaTemplate
fabapp2 Aug 7, 2023
d567ec1
Fix testdata in test which was surfaced by the new parser
fabapp2 Aug 7, 2023
f6240e2
Update year in license-check plugin
fabapp2 Aug 8, 2023
9dee673
Add dependencies
fabapp2 Aug 8, 2023
849dd06
Add java version property to test pom
fabapp2 Aug 8, 2023
363e1f3
Add logging
fabapp2 Aug 8, 2023
5a2e347
Bump shrinkwrap version to be compatible with Maven deps
fabapp2 Aug 8, 2023
623ab1f
Fixing stream was closed
fabapp2 Aug 8, 2023
d1dbb78
Fix TestProjectContext
fabapp2 Aug 8, 2023
ed7a68e
Test fails because parser does not resolve deps
fabapp2 Aug 8, 2023
4b770b2
Test fails because parser does not resolve deps
fabapp2 Aug 8, 2023
46f3b55
Clear cached result in test
fabapp2 Aug 8, 2023
8e76a1b
Change access to expected resources in test
fabapp2 Aug 8, 2023
3c1f7a1
Change test resources from .foo to .properties to access content
fabapp2 Aug 8, 2023
3903393
TestProjectContext uses default root (target) to write resources
fabapp2 Aug 8, 2023
136524a
Fix compilation errors in testcode
fabapp2 Aug 8, 2023
1a09ac8
Fix endless loop
fabapp2 Aug 8, 2023
00250a6
Change test resources from .txt to .properties to access content
fabapp2 Aug 8, 2023
6c491be
Expect different error behaviour
fabapp2 Aug 8, 2023
dd9a835
use temp dir as default
fabapp2 Aug 8, 2023
3c8b64d
Fix compilation errors in testcode
fabapp2 Aug 8, 2023
94fca9b
Fix compilation errors in testcode
fabapp2 Aug 8, 2023
6c11477
Fix tests
fabapp2 Aug 8, 2023
2635d9a
[maven-release-plugin] prepare release 0.15.1
fabapp2 Aug 6, 2023
76c5d3d
Moved scope package to sbm-support-rewrite
fabapp2 Aug 8, 2023
896e4ba
ScanScope handled in parser
fabapp2 Aug 8, 2023
e21b09e
Fixing ArchUnit condition after moving scoped beans logic
fabapp2 Aug 8, 2023
cff6e02
Moved JavaParserBuilder into sbm-support-rewrite
fabapp2 Aug 8, 2023
de89b89
Fixed some tests
fabapp2 Aug 9, 2023
4deef4c
Fix maven setup in test
fabapp2 Aug 9, 2023
82fe3c6
Fix compile and maven errors in testscode
fabapp2 Aug 9, 2023
5f0f36b
Add java version in test pom fixes test
fabapp2 Aug 9, 2023
0777b76
Fix test
fabapp2 Aug 9, 2023
2b42ee6
Fix mock in test
fabapp2 Aug 9, 2023
7239b55
Add java version in test pom fixes test
fabapp2 Aug 9, 2023
8fa31de
Fix test
fabapp2 Aug 9, 2023
5b7a64d
Fix RewriteMigrationResultMerger
fabapp2 Aug 9, 2023
cd7b931
Fix tests and adjust to changes in OR 8.1.2
fabapp2 Aug 10, 2023
8ebe161
WIP
fabapp2 Aug 10, 2023
abd1e5d
WIP
fabapp2 Aug 11, 2023
a115da8
Change list of Path to set
fabapp2 Aug 18, 2023
7fd0be2
FIx PomBuilder
fabapp2 Aug 18, 2023
a3854a2
Generalize type
fabapp2 Aug 18, 2023
d99cf03
JavaHelper in utils of sbm-support-rewrite
fabapp2 Aug 18, 2023
d85acb8
Load bean only if no other defined
fabapp2 Aug 18, 2023
ca97a35
Move RewriteExecutionContext into sbm-support-rewrite
fabapp2 Aug 18, 2023
388da4c
Remove broken flag from AddAnnotationVisitor
fabapp2 Aug 18, 2023
8ec62ea
RewriteMavenProjectParser uses ExecutionContext from application context
fabapp2 Aug 18, 2023
90a21ed
WIP: Add dependency
fabapp2 Aug 18, 2023
99ed405
Fix compile error
fabapp2 Aug 18, 2023
7cf0d50
Add assertion
fabapp2 Aug 18, 2023
b2f5be2
Removed obsolete parameter
fabapp2 Aug 19, 2023
0263aa2
WIP
fabapp2 Aug 19, 2023
771ab87
Take ignore pattern from properties
fabapp2 Aug 19, 2023
1f065c9
Use injected ExecutionContext
fabapp2 Aug 19, 2023
6c0949a
WIP
fabapp2 Aug 22, 2023
45d027f
fix versions
fabapp2 Aug 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.engine.recipe.Recipe;
import org.springframework.sbm.engine.recipe.UserInteractions;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.parser.ProjectContextInitializer;
import org.springframework.sbm.spring.migration.actions.InitDataSourceAfterJpaInitAction;
import org.springframework.sbm.test.ProjectContextFileSystemTestSupport;
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
import org.springframework.core.io.Resource;
import org.springframework.sbm.engine.commands.ScanCommand;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.parser.ProjectContextInitializer;

import java.io.IOException;
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.scopes.annotations.ScanScope;

import java.util.function.Supplier;

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import org.openrewrite.maven.cache.LocalMavenArtifactCache;
import org.openrewrite.maven.cache.ReadOnlyLocalMavenArtifactCache;
import org.openrewrite.maven.utilities.MavenArtifactDownloader;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;

import java.nio.file.Path;
import java.nio.file.Paths;
Original file line number Diff line number Diff line change
@@ -17,7 +17,6 @@

import org.openrewrite.ExecutionContext;
import org.openrewrite.internal.InMemoryLargeSourceSet;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.project.resource.RewriteSourceFileHolder;
import org.springframework.sbm.properties.migration.recipes.AddProperty;
import lombok.extern.slf4j.Slf4j;
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
import org.springframework.sbm.engine.recipe.Action;
import org.springframework.sbm.engine.recipe.Condition;
import org.springframework.sbm.engine.recipe.Recipe;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.scopes.ProjectMetadata;
import java.util.UUID;

Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Configuration;
import org.springframework.sbm.SbmCoreConfig;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.scopes.ScopeConfiguration;

import static com.tngtech.archunit.lang.conditions.ArchConditions.notBe;
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@

import org.junit.jupiter.api.Test;
import org.openrewrite.ExecutionContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;

import static org.assertj.core.api.Assertions.assertThat;

Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
import org.junit.jupiter.api.*;
import org.openrewrite.maven.MavenExecutionContextView;
import org.openrewrite.maven.tree.MavenRepository;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;

import java.net.URI;
import java.net.URISyntaxException;
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.RewriteSourceFileWrapper;
import org.springframework.sbm.project.resource.ResourceHelper;
import org.springframework.sbm.project.resource.TestProjectContext;
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.RewriteSourceFileWrapper;
import org.springframework.sbm.project.resource.ResourceHelper;
import org.springframework.sbm.project.resource.TestProjectContext;
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
import org.openrewrite.xml.tree.Xml;
import org.springframework.sbm.build.impl.MavenSettingsInitializer;
import org.springframework.sbm.build.impl.RewriteMavenParser;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;

import java.util.List;
import java.util.Set;
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import org.openrewrite.internal.InMemoryLargeSourceSet;
import org.openrewrite.java.JavaParser;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.resource.SbmApplicationProperties;
import org.springframework.sbm.project.resource.TestProjectContext;
import org.junit.jupiter.api.Test;
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
import org.openrewrite.java.tree.J;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.resource.SbmApplicationProperties;

import java.io.ByteArrayOutputStream;
Original file line number Diff line number Diff line change
@@ -36,17 +36,13 @@
import org.springframework.sbm.java.impl.DependenciesChangedEventHandler;
import org.springframework.sbm.java.impl.DependencyChangeHandler;
import org.springframework.sbm.java.impl.RewriteJavaParser;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.parsers.JavaParserBuilder;
import org.springframework.sbm.project.resource.SbmApplicationProperties;
import org.springframework.sbm.project.resource.TestProjectContext;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.*;
import java.util.stream.Collectors;

import static org.assertj.core.api.Assertions.assertThat;
@@ -1434,7 +1430,7 @@ void testAddToDependencyManagement() {

assertEventPublished(eventPublisher, argumentCaptor, DependenciesChangedEvent.class, 1);

Map<Scope, List<Path>> resolvedDependencies = argumentCaptor.getValue().resolvedDependencies();
Map<Scope, Set<Path>> resolvedDependencies = argumentCaptor.getValue().resolvedDependencies();
assertThat(resolvedDependencies).hasSize(1);
Path pathInMavenRepo = Path.of("org/slf4j/slf4j-api/1.7.32/slf4j-api-1.7.32.jar");
assertThat(resolvedDependencies.get(0)).endsWith(pathInMavenRepo);
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
import org.openrewrite.xml.tree.Xml;
import org.springframework.sbm.build.impl.MavenSettingsInitializer;
import org.springframework.sbm.build.impl.RewriteMavenParser;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;

import java.nio.file.Path;
import java.util.List;
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.core.io.Resource;
import org.springframework.sbm.engine.events.StartedScanningProjectResourceEvent;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.TestDummyResource;
import org.springframework.sbm.properties.parser.RewritePropertiesParser;
import org.springframework.sbm.xml.parser.RewriteXmlParser;
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.openrewrite.xml.tree.Xml;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.TestDummyResource;
import org.springframework.sbm.project.resource.RewriteSourceFileHolder;
import org.springframework.sbm.xml.parser.RewriteXmlParser;
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@
import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.lang.ArchRule;
import org.openrewrite.ExecutionContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.scopes.ScopeConfiguration;

import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.noClasses;
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
import org.springframework.sbm.boot.properties.api.SpringBootApplicationProperties;
import org.springframework.sbm.boot.properties.SpringBootApplicationPropertiesRegistrar;
import org.springframework.sbm.boot.properties.search.SpringBootApplicationPropertiesResourceListFilter;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.resource.TestProjectContext;
import org.junit.jupiter.api.Test;

Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
import org.springframework.sbm.boot.properties.SpringApplicationPropertiesPathMatcher;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.boot.properties.SpringBootApplicationPropertiesRegistrar;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.resource.TestProjectContext;
import org.junit.jupiter.api.Test;

Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
import org.springframework.sbm.boot.properties.api.SpringBootApplicationProperties;
import org.springframework.sbm.boot.properties.search.SpringBootApplicationPropertiesResourceListFilter;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.resource.TestProjectContext;

import java.util.List;
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
import org.springframework.sbm.boot.properties.api.SpringBootApplicationProperties;
import org.springframework.sbm.boot.properties.search.SpringBootApplicationPropertiesResourceListFilter;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.resource.TestProjectContext;

import java.util.List;
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
import org.springframework.sbm.boot.properties.SpringApplicationPropertiesPathMatcher;
import org.springframework.sbm.boot.properties.SpringBootApplicationPropertiesRegistrar;
import org.springframework.sbm.engine.context.ProjectContext;
import org.springframework.sbm.openrewrite.RewriteExecutionContext;
import org.springframework.sbm.parsers.RewriteExecutionContext;
import org.springframework.sbm.project.resource.TestProjectContext;

import java.nio.file.Path;
Loading