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

Close the app bootstrapped in generate-code-tests #24173

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ void generateCode(Path sourcesDir,
}

ClassLoader originalTccl = Thread.currentThread().getContextClassLoader();
CuratedApplication curatedApplication = null;
try {

final CuratedApplication curatedApplication = bootstrapApplication(launchMode);
curatedApplication = bootstrapApplication(launchMode);

QuarkusClassLoader deploymentClassLoader = curatedApplication.createDeploymentClassLoader();
Thread.currentThread().setContextClassLoader(deploymentClassLoader);
Expand All @@ -85,6 +86,10 @@ void generateCode(Path sourcesDir,
} catch (Exception any) {
throw new MojoExecutionException("Quarkus code generation phase has failed", any);
} finally {
// in case of test mode, we can't share the bootstrapped app with the testing plugins, so we are closing it right away
if (test && curatedApplication != null) {
curatedApplication.close();
}
Thread.currentThread().setContextClassLoader(originalTccl);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,13 @@ private ArtifactCoords appArtifact(QuarkusBootstrapMojo mojo)
final String groupId = coordsArr[0];
final String artifactId = coordsArr[1];
String classifier = "";
String type = GACTV.TYPE_JAR;
String type = ArtifactCoords.TYPE_JAR;
String version = null;
if (coordsArr.length == 3) {
version = coordsArr[2];
} else if (coordsArr.length > 3) {
classifier = coordsArr[2] == null ? "" : coordsArr[2];
type = coordsArr[3] == null ? "jar" : coordsArr[3];
type = coordsArr[3] == null ? ArtifactCoords.TYPE_JAR : coordsArr[3];
if (coordsArr.length > 4) {
version = coordsArr[4];
}
Expand Down