Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
xmvn.28016
0001-Simple-implementation-of-toolchains-https-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Simple-implementation-of-toolchains-https-github.com.patch of Package xmvn.28016
From acb236f878b020722512b1ce0ba20329500083c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch> Date: Sat, 7 May 2022 18:13:02 +0200 Subject: [PATCH 1/2] Simple implementation of toolchains https://github.com/fedora-java/xmvn/issues/142 --- .../fedoraproject/xmvn/mojo/JavadocMojo.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/JavadocMojo.java b/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/JavadocMojo.java index b2cd41fd..2b06e702 100644 --- a/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/JavadocMojo.java +++ b/xmvn-mojo/src/main/java/org/fedoraproject/xmvn/mojo/JavadocMojo.java @@ -45,6 +45,8 @@ import org.apache.maven.project.DependencyResolutionRequest; import org.apache.maven.project.DependencyResolutionResult; import org.apache.maven.project.MavenProject; import org.apache.maven.project.ProjectDependenciesResolver; +import org.apache.maven.toolchain.Toolchain; +import org.apache.maven.toolchain.ToolchainManager; import org.codehaus.plexus.logging.Logger; import org.codehaus.plexus.util.StringUtils; import org.eclipse.aether.util.filter.AndDependencyFilter; @@ -69,6 +71,9 @@ public class JavadocMojo @Component private Configurator confugurator; + @Component + private ToolchainManager toolchainManager; + @Parameter( defaultValue = "${session}", readonly = true ) private MavenSession session; @@ -161,8 +166,18 @@ public class JavadocMojo public void execute() throws MojoExecutionException, MojoFailureException { + String javadocTool = null; + Toolchain tc = toolchainManager.getToolchainFromBuildContext( "jdk", session ); + if ( tc != null ) + { + javadocTool = tc.findTool( "javadoc" ); + } Path javadocExecutable; - if ( System.getenv().containsKey( "JAVA_HOME" ) ) + if ( javadocTool != null && !javadocTool.isEmpty() ) + { + javadocExecutable = Paths.get( javadocTool ); + } + else if ( System.getenv().containsKey( "JAVA_HOME" ) ) { javadocExecutable = Paths.get( System.getenv( "JAVA_HOME" ) ) // .resolve( "bin" ) // -- 2.36.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor