Skip to content

Commit

Permalink
Merge pull request #44965 from amusarra/feature/ext-info-added-info
Browse files Browse the repository at this point in the history
Extension Info - Added the additional info
  • Loading branch information
geoand authored Dec 6, 2024
2 parents 74457f7 + ebe80d5 commit b9de708
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
import io.quarkus.deployment.annotations.Record;
import io.quarkus.deployment.builditem.ApplicationInfoBuildItem;
import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem;
import io.quarkus.deployment.pkg.builditem.OutputTargetBuildItem;
import io.quarkus.info.BuildInfo;
Expand Down Expand Up @@ -111,6 +112,7 @@ void gitInfo(InfoBuildTimeConfig config,

commit.put("id", id);

data.put("remote", git.getRepository().getConfig().getString("remote", "origin", "url"));
data.put("tags", getTags(git, latestCommit));
}

Expand Down Expand Up @@ -208,10 +210,13 @@ void buildInfo(CurateOutcomeBuildItem curateOutcomeBuildItem,
InfoBuildTimeConfig config,
BuildProducer<InfoBuildTimeValuesBuildItem> valuesProducer,
BuildProducer<SyntheticBeanBuildItem> beanProducer,
ApplicationInfoBuildItem infoApplication,
InfoRecorder recorder) {
ApplicationModel applicationModel = curateOutcomeBuildItem.getApplicationModel();
ResolvedDependency appArtifact = applicationModel.getAppArtifact();
Map<String, Object> buildData = new LinkedHashMap<>();
String name = infoApplication.getName();
buildData.put("name", name);
String group = appArtifact.getGroupId();
buildData.put("group", group);
String artifact = appArtifact.getArtifactId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ public Map<String, Object> data() {
//TODO: should we add more information like 'java.runtime.*' and 'java.vm.*' ?
Map<String, Object> result = new LinkedHashMap<>();
result.put("version", getVersion());
result.put("vendor", getVendor());
result.put("vendorVersion", getVendorVersion());
return result;
}

static String getVersion() {
return System.getProperty("java.version");
}

static String getVendor() {
return System.getProperty("java.vendor");
}

static String getVendorVersion() {
return System.getProperty("java.vendor.version");
}
}

0 comments on commit b9de708

Please sign in to comment.