Skip to content

Commit

Permalink
Expose maven and java version on validate command (#454)
Browse files Browse the repository at this point in the history
Co-authored-by: Bruno Verachten <[email protected]>
  • Loading branch information
jonesbusy and gounthar authored Dec 13, 2024
1 parent 50ddeaa commit f476a50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public Integer call() throws Exception {
modernizer.validate();
LOG.info("GitHub owner: {}", modernizer.getGithubOwner());
LOG.info("Maven home: {}", config.getMavenHome());
LOG.info("Maven version: {}", modernizer.getMavenVersion());
LOG.info("Java version: {}", modernizer.getJavaVersion());
LOG.info("Cache path: {}", config.getCachePath());
} catch (ModernizerException e) {
LOG.error("Validation error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@ public String getGithubOwner() {
return ghService.getGithubOwner();
}

/**
* Expose the effective Maven version
* @return The Maven version
*/
public String getMavenVersion() {
return mavenInvoker.getMavenVersion() != null
? mavenInvoker.getMavenVersion().toString()
: "unknown";
}

/**
* Expose the effective Java version
* @return The Java version
*/
public String getJavaVersion() {
return System.getProperty("java.version");
}

/**
* Entry point to start the plugin modernization process
*/
Expand Down

0 comments on commit f476a50

Please sign in to comment.