Skip to content

Commit

Permalink
Upgrade to Quarkus 2.13.3.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed Oct 19, 2022
1 parent 3414b11 commit 338f87e
Show file tree
Hide file tree
Showing 10 changed files with 1,227 additions and 1,211 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 @@ -964,7 +964,7 @@
<dependency>
<groupId>io.smallrye.reactive</groupId>
<artifactId>smallrye-reactive-messaging-camel</artifactId>
<version>3.20.0</version>
<version>3.21.0</version>
<exclusions>
<exclusion>
<groupId>jakarta.activation</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.BuildBase;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Model;
import org.apache.maven.model.Plugin;
import org.apache.maven.model.PluginExecution;
import org.apache.maven.model.Profile;
Expand Down Expand Up @@ -121,8 +120,6 @@
@Mojo(name = "dev", defaultPhase = LifecyclePhase.PREPARE_PACKAGE, requiresDependencyResolution = ResolutionScope.TEST, threadSafe = true)
public class DevMojo extends AbstractMojo {

private static final String EXT_PROPERTIES_PATH = "META-INF/quarkus-extension.properties";

private static final String KOTLIN_MAVEN_PLUGIN_GA = "org.jetbrains.kotlin:kotlin-maven-plugin";

/**
Expand Down Expand Up @@ -441,7 +438,7 @@ public void execute() throws MojoFailureException, MojoExecutionException {
try {
triggerCompile(false, false);
triggerCompile(true, false);
newRunner = new DevModeRunner();
newRunner = new DevModeRunner(runner.launcher.getDebugPortOk());
} catch (Exception e) {
getLog().info("Could not load changed pom.xml file, changes not applied", e);
continue;
Expand Down Expand Up @@ -892,7 +889,11 @@ private class DevModeRunner {
private Process process;

private DevModeRunner() throws Exception {
launcher = newLauncher();
launcher = newLauncher(null);
}

private DevModeRunner(Boolean debugPortOk) throws Exception {
launcher = newLauncher(debugPortOk);
}

Collection<Path> pomFiles() {
Expand Down Expand Up @@ -946,7 +947,7 @@ void stop() throws InterruptedException {
}
}

private QuarkusDevModeLauncher newLauncher() throws Exception {
private QuarkusDevModeLauncher newLauncher(Boolean debugPortOk) throws Exception {
String java = null;
// See if a toolchain is configured
if (toolchainManager != null) {
Expand All @@ -965,6 +966,7 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
.debug(debug)
.debugHost(debugHost)
.debugPort(debugPort)
.debugPortOk(debugPortOk)
.deleteDevJar(deleteDevJar);

setJvmArgs(builder);
Expand Down Expand Up @@ -1081,11 +1083,7 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
mvnConfig.setRepositorySystemSession(repoSession).setRepositorySystem(repoSystem);
// there could be Maven extensions manipulating the project versions and models
// the ones returned from the Maven API could be different from the original pom.xml files
final Map<Path, Model> projectModels = new HashMap<>(session.getAllProjects().size());
for (MavenProject mp : session.getAllProjects()) {
projectModels.put(mp.getBasedir().toPath(), mp.getOriginalModel());
}
mvnConfig.setProjectModelProvider(projectModels::get);
mvnConfig.setProjectModelProvider(QuarkusBootstrapProvider.getProjectMap(session)::get);
}

final BootstrapMavenContext mvnCtx = new BootstrapMavenContext(mvnConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void generateCode(PathCollection sourceParents,
Thread.currentThread().setContextClassLoader(deploymentClassLoader);

final Class<?> codeGenerator = deploymentClassLoader.loadClass("io.quarkus.deployment.CodeGenerator");
final Method initAndRun = codeGenerator.getMethod("initAndRun", ClassLoader.class, PathCollection.class,
final Method initAndRun = codeGenerator.getMethod("initAndRun", QuarkusClassLoader.class, PathCollection.class,
Path.class, Path.class,
Consumer.class, ApplicationModel.class, Properties.class, String.class,
boolean.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ private void resolveAppModel(final MavenArtifactResolver resolver, final Artifac
private MavenArtifactResolver getResolver() throws MojoExecutionException {
try {
return MavenArtifactResolver.builder()
.setCurrentProject(project.getBasedir().toString())
.setRemoteRepositoryManager(remoteRepositoryManager)
.setRemoteRepositories(repos)
.setPreferPomsFromWorkspace(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.concurrent.ExecutionException;

import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Model;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
Expand Down Expand Up @@ -63,6 +64,16 @@ static ArtifactKey getProjectId(MavenProject project) {
return ArtifactKey.ga(project.getGroupId(), project.getArtifactId());
}

static Map<Path, Model> getProjectMap(MavenSession session) {
final List<MavenProject> allProjects = session.getAllProjects();
final Map<Path, Model> projectModels = new HashMap<>(allProjects.size());
for (MavenProject mp : allProjects) {
mp.getOriginalModel().setPomFile(mp.getFile());
projectModels.put(mp.getBasedir().toPath(), mp.getOriginalModel());
}
return projectModels;
}

public RepositorySystem repositorySystem() {
return repoSystem;
}
Expand Down Expand Up @@ -143,11 +154,7 @@ private MavenArtifactResolver artifactResolver(QuarkusBootstrapMojo mojo, Launch
.setRemoteRepositories(mojo.remoteRepositories())
.setRemoteRepositoryManager(remoteRepoManager);
if (mode == LaunchMode.DEVELOPMENT || mode == LaunchMode.TEST || isWorkspaceDiscovery(mojo)) {
final Map<Path, Model> projectModels = new HashMap<>(mojo.mavenSession().getAllProjects().size());
for (MavenProject mp : mojo.mavenSession().getAllProjects()) {
projectModels.put(mp.getBasedir().toPath(), mp.getOriginalModel());
}
builder.setWorkspaceDiscovery(true).setProjectModelProvider(projectModels::get);
builder.setWorkspaceDiscovery(true).setProjectModelProvider(getProjectMap(mojo.mavenSession())::get);
}
return builder.build();
} catch (BootstrapMavenException e) {
Expand Down
Loading

0 comments on commit 338f87e

Please sign in to comment.