Make application version and name available as runtime properties

Fixes: #6255

Co-authored-by: Guillaume Smet <guillaume.smet@gmail.com>
This commit is contained in:
Georgios Andrianakis
2019-12-19 12:39:50 +02:00
parent 7c017871d0
commit 6aee06ba92
4 changed files with 12 additions and 5 deletions

View File

@@ -490,7 +490,13 @@ public class DevMojo extends AbstractMojo {
for (Map.Entry<Object, Object> e : System.getProperties().entrySet()) {
devModeContext.getSystemProperties().put(e.getKey().toString(), (String) e.getValue());
}
devModeContext.getBuildSystemProperties().putAll((Map) project.getProperties());
// this is a minor hack to allow ApplicationConfig to be populated with defaults
devModeContext.getBuildSystemProperties().putIfAbsent("quarkus.application.name", project.getArtifactId());
devModeContext.getBuildSystemProperties().putIfAbsent("quarkus.application.version", project.getVersion());
devModeContext.setSourceEncoding(getSourceEncoding());
devModeContext.setSourceJavaVersion(source);
devModeContext.setTargetJvmVersion(target);