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

Minor refactoring in maven bootstrap plugin #20516

Merged
merged 1 commit into from
Oct 4, 2021
Merged
Changes from all commits
Commits
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
Expand Up @@ -512,13 +512,7 @@ private void setBuiltWithQuarkusCoreVersion(ObjectNode extObject) throws MojoExe
}
root.accept(coreVersionLocator);
if (coreVersionLocator.coreVersion != null) {
ObjectNode metadata;
JsonNode mvalue = extObject.get(METADATA);
if (mvalue != null && mvalue.isObject()) {
metadata = (ObjectNode) mvalue;
} else {
metadata = extObject.putObject(METADATA);
}
ObjectNode metadata = getMetadataNode(extObject);
metadata.put("built-with-quarkus-core", coreVersionLocator.coreVersion);
} else if (!ignoreNotDetectedQuarkusCoreVersion) {
throw new MojoExecutionException("Failed to determine the Quarkus core version used to build the extension");
Expand Down Expand Up @@ -943,7 +937,7 @@ private boolean isJarFile(final File f) {
}

private void transformLegacyToNew(ObjectNode extObject, ObjectMapper mapper) {
ObjectNode metadata = null;
ObjectNode metadata = getMetadataNode(extObject);

// Note: groupId and artifactId shouldn't normally be in the source json but
// just putting it
Expand All @@ -958,13 +952,6 @@ private void transformLegacyToNew(ObjectNode extObject, ObjectMapper mapper) {
extObject.remove("artifactId");
}

JsonNode mvalue = extObject.get(METADATA);
if (mvalue != null && mvalue.isObject()) {
metadata = (ObjectNode) mvalue;
} else {
metadata = mapper.createObjectNode();
}

if (extObject.get("labels") != null) {
metadata.set("keywords", extObject.get("labels"));
extObject.remove("labels");
Expand Down