Package org.tentackle.maven
Class JavaToolFinder
- java.lang.Object
-
- org.tentackle.common.ToolFinder
-
- org.tentackle.maven.JavaToolFinder
-
public class JavaToolFinder extends org.tentackle.common.ToolFinderFinds java tools to execute on behalf of a maven plugin.
-
-
Constructor Summary
Constructors Constructor Description JavaToolFinder()Creates a toolfinder without toolchain.JavaToolFinder(org.apache.maven.toolchain.Toolchain toolchain)Creates the toolfinder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.Filefind(java.lang.String toolName)Finds the file of a java tool.
-
-
-
Method Detail
-
find
public java.io.File find(java.lang.String toolName)
Finds the file of a java tool.If the finder was created with
JavaToolFinder(Toolchain), the toolchain is consulted first. Otherwise or if not found by the toolchain, it looks in the same directory where the current command (usually java) is located. This is safe for all JDK tools, whether JAVA_HOME or PATH is configured correctly or not.
If not found, the environment JAVA_HOME ist tried.
If still not found, the environment's PATH variable is consulted.Depending on the OS, it will also try to append well-known suffixes to the toolName. Windows: ".exe", ".cmd" and ".bat". Others (Unixes): ".sh".
- Overrides:
findin classorg.tentackle.common.ToolFinder- Parameters:
toolName- the platform independent tool name- Returns:
- file representing the tool's executable, or null if the tool can not be found
- See Also:
ToolFinder.find(String)
-
-