Skip to content

Commit

Permalink
Merge pull request #528 from gsmet/quarkus-2.8.1
Browse files Browse the repository at this point in the history
Upgrade to Quarkus 2.8.1.Final
  • Loading branch information
gsmet authored Apr 19, 2022
2 parents 86781c0 + f96df21 commit 4dd1482
Show file tree
Hide file tree
Showing 8 changed files with 1,988 additions and 1,947 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.6.Final</version>
<version>13.0.8.Final</version>
</dependency>
<dependency>
<groupId>org.influxdb</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.BuildPluginManager;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.descriptor.MojoDescriptor;
Expand Down Expand Up @@ -345,6 +346,9 @@ public class DevMojo extends AbstractMojo {
@Component
protected QuarkusBootstrapProvider bootstrapProvider;

@Parameter(defaultValue = "${mojoExecution}", readonly = true, required = true)
MojoExecution mojoExecution;

/**
* console attributes, used to restore the console state
*/
Expand Down Expand Up @@ -549,15 +553,15 @@ private void triggerPrepare(boolean test) throws MojoExecutionException {
final PluginDescriptor pluginDescr = getPluginDescriptor();
executeIfConfigured(pluginDescr.getGroupId(), pluginDescr.getArtifactId(),
test ? QUARKUS_GENERATE_CODE_TESTS_GOAL : QUARKUS_GENERATE_CODE_GOAL,
Collections.singletonMap("mode", LaunchMode.DEVELOPMENT.name()));
Map.of("mode", LaunchMode.DEVELOPMENT.name(), QuarkusBootstrapMojo.CLOSE_BOOTSTRAPPED_APP, "false"));
}

private void initClassIndexes() throws MojoExecutionException {
executeIfConfigured(ORG_JBOSS_JANDEX, JANDEX_MAVEN_PLUGIN, "jandex", Collections.emptyMap());
}

private PluginDescriptor getPluginDescriptor() {
return (PluginDescriptor) getPluginContext().get("pluginDescriptor");
return mojoExecution.getMojoDescriptor().getPluginDescriptor();
}

private void triggerCompile(boolean test, boolean prepareNeeded) throws MojoExecutionException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

public abstract class QuarkusBootstrapMojo extends AbstractMojo {

static final String CLOSE_BOOTSTRAPPED_APP = "closeBootstrappedApp";

@Component
protected QuarkusBootstrapProvider bootstrapProvider;

Expand Down Expand Up @@ -135,6 +137,12 @@ public abstract class QuarkusBootstrapMojo extends AbstractMojo {
@Parameter(defaultValue = "${mojoExecution}", readonly = true, required = true)
private MojoExecution mojoExecution;

/**
* Whether to close the bootstrapped applications after the execution
*/
@Parameter(property = "quarkusCloseBootstrappedApp")
private Boolean closeBootstrappedApp;

private ArtifactKey projectId;

@Override
Expand All @@ -145,7 +153,14 @@ public void execute() throws MojoExecutionException, MojoFailureException {
try {
doExecute();
} finally {
if (!bootstrapSessionListener.isEnabled()) {
if (closeBootstrappedApp != null) {
// This trick is for dev mode from which we invoke other goals using the invoker API,
// in which case the session listener won't be enabled and the app bootstrapped in generate-code will be closed immediately
// causing DevMojo to bootstrap a new instance
if (closeBootstrappedApp) {
bootstrapProvider.bootstrapper(this).close();
}
} else if (!bootstrapSessionListener.isEnabled()) {
bootstrapProvider.bootstrapper(this).close();
}
}
Expand Down
Loading

0 comments on commit 4dd1482

Please sign in to comment.