Skip to content

Commit

Permalink
Upgrade to Quarkus 2.9.0.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed May 4, 2022
1 parent ec73ba5 commit ec8cab2
Show file tree
Hide file tree
Showing 7 changed files with 1,237 additions and 1,210 deletions.
2 changes: 1 addition & 1 deletion generated-platform-project/quarkus-camel/bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10485,7 +10485,7 @@
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-jboss-marshalling</artifactId>
<version>13.0.8.Final</version>
<version>13.0.9.Final</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -721,12 +721,16 @@ private String getSourceEncoding() {

private void addProject(MavenDevModeLauncher.Builder builder, ResolvedDependency module, boolean root) throws Exception {

if (!ArtifactCoords.TYPE_JAR.equals(module.getType())) {
return;
}

String projectDirectory;
Set<Path> sourcePaths;
String classesPath = null;
Set<Path> resourcePaths;
Set<Path> testSourcePaths;
String testClassesPath;
String testClassesPath = null;
Set<Path> testResourcePaths;
List<Profile> activeProfiles = Collections.emptyList();

Expand All @@ -736,6 +740,10 @@ private void addProject(MavenDevModeLauncher.Builder builder, ResolvedDependency
: null;
final ArtifactSources sources = module.getSources();
if (mavenProject == null) {
if (sources == null) {
getLog().debug("Local dependency " + module.toCompactCoords() + " does not appear to have any sources");
return;
}
projectDirectory = module.getWorkspaceModule().getModuleDir().getAbsolutePath();
sourcePaths = new LinkedHashSet<>();
for (SourceDir src : sources.getSourceDirs()) {
Expand Down Expand Up @@ -766,28 +774,33 @@ private void addProject(MavenDevModeLauncher.Builder builder, ResolvedDependency
}

final Path sourceParent;
if (sources.getSourceDirs() == null) {
if (sources.getResourceDirs() == null) {
throw new MojoExecutionException("The project does not appear to contain any sources or resources");
if (sourcePaths.isEmpty()) {
if (sources == null || sources.getResourceDirs() == null) {
throw new MojoExecutionException(
"Local dependency " + module.toCompactCoords() + " does not appear to have any sources");
}
sourceParent = sources.getResourceDirs().iterator().next().getDir().toAbsolutePath().getParent();
} else {
sourceParent = sources.getSourceDirs().iterator().next().getDir().toAbsolutePath().getParent();
sourceParent = sourcePaths.iterator().next().toAbsolutePath().getParent();
}

Path classesDir = sources.getSourceDirs().iterator().next().getOutputDir().toAbsolutePath();
if (Files.isDirectory(classesDir)) {
classesPath = classesDir.toString();
}
Path testClassesDir = module.getWorkspaceModule().getTestSources().getSourceDirs().iterator().next().getOutputDir()
.toAbsolutePath();
testClassesPath = testClassesDir.toString();

Path classesDir = null;
resourcePaths = new LinkedHashSet<>();
for (SourceDir src : sources.getResourceDirs()) {
for (Path p : src.getSourceTree().getRoots()) {
resourcePaths.add(p.toAbsolutePath());
if (sources != null) {
classesDir = sources.getSourceDirs().iterator().next().getOutputDir().toAbsolutePath();
if (Files.isDirectory(classesDir)) {
classesPath = classesDir.toString();
}
for (SourceDir src : sources.getResourceDirs()) {
for (Path p : src.getSourceTree().getRoots()) {
resourcePaths.add(p.toAbsolutePath());
}
}
}
if (module.getWorkspaceModule().hasTestSources()) {
Path testClassesDir = module.getWorkspaceModule().getTestSources().getSourceDirs().iterator().next().getOutputDir()
.toAbsolutePath();
testClassesPath = testClassesDir.toString();
}

testResourcePaths = new LinkedHashSet<>();
Expand All @@ -807,24 +820,25 @@ private void addProject(MavenDevModeLauncher.Builder builder, ResolvedDependency
resourcePaths.addAll(
build.getResources().stream()
.map(Resource::getDirectory)
.map(Paths::get)
.map(Path::of)
.map(Path::toAbsolutePath)
.collect(Collectors.toList()));
testResourcePaths.addAll(
build.getTestResources().stream()
.map(Resource::getDirectory)
.map(Paths::get)
.map(Path::of)
.map(Path::toAbsolutePath)
.collect(Collectors.toList()));
}
}

if (classesPath == null && (!sourcePaths.isEmpty() || !resourcePaths.isEmpty())) {
throw new MojoExecutionException("Hot reloadable dependency " + module.getWorkspaceModule().getId()
+ " has not been compiled yet (the classes directory " + classesDir + " does not exist)");
+ " has not been compiled yet (the classes directory " + (classesDir == null ? "" : classesDir)
+ " does not exist)");
}

Path targetDir = Paths.get(project.getBuild().getDirectory());
Path targetDir = Path.of(project.getBuild().getDirectory());

DevModeContext.ModuleInfo moduleInfo = new DevModeContext.ModuleInfo.Builder()
.setArtifactKey(module.getKey())
Expand Down Expand Up @@ -990,7 +1004,6 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
bootstrapProvider.close();
} else {
final MavenArtifactResolver.Builder resolverBuilder = MavenArtifactResolver.builder()
.setRepositorySystem(repoSystem)
.setRemoteRepositories(repos)
.setRemoteRepositoryManager(remoteRepositoryManager)
.setWorkspaceDiscovery(true)
Expand All @@ -1002,16 +1015,18 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
boolean reinitializeMavenSession = Files.exists(appModelLocation);
if (reinitializeMavenSession) {
Files.delete(appModelLocation);
// we can't re-use the repo system because we want to use our interpolating model builder
// a use-case where it fails with the original repo system is when dev mode is launched with -Dquarkus.platform.version=xxx
// overriding the version of the quarkus-bom in the pom.xml
} else {
// we can re-use the original Maven session
resolverBuilder.setRepositorySystemSession(repoSession);
resolverBuilder.setRepositorySystemSession(repoSession).setRepositorySystem(repoSystem);
}

appModel = new BootstrapAppModelResolver(resolverBuilder.build())
.setDevMode(true)
.setCollectReloadableDependencies(!noDeps)
.resolveModel(new GACTV(project.getGroupId(), project.getArtifactId(), null, ArtifactCoords.TYPE_JAR,
project.getVersion()));
.resolveModel(GACTV.jar(project.getGroupId(), project.getArtifactId(), project.getVersion()));
}

// serialize the app model to avoid re-resolving it in the dev process
Expand Down
Loading

0 comments on commit ec8cab2

Please sign in to comment.