Package org.codehaus.plexus.compiler
Class CompilerConfiguration
java.lang.Object
org.codehaus.plexus.compiler.CompilerConfiguration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumRe-use strategy of the compiler (implement for java only). -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String[]-processor parameters in jdk 1.6+private FileA build temporary directory, eg target/.default valueCompilerConfiguration.CompilerReuseStrategy.ReuseCreatedprivate Stringprivate Collection<Map.Entry<String,String>> private booleanprivate Stringforce a different of the debug file containing the forked command run (such javac.sh)private Stringprivate booleanconfigure--enable-previewof java compilerprivate Stringprivate boolean-Werror argument as supported since Java 1.7private booleanforce usage of old JavacCompiler even if javax.tools is detectedprivate booleanprivate Filein jdk 1.6+, used to hold value of the -s path parameter.private Stringprivate Stringprivate Stringvalue of --module-version parameter in java 9+private booleanprivate StringUsed to control the name of the output file when compiling a set of sources to a single file.private Stringprivate booleanprivate Stringvalue of the -proc parameter in jdk 1.6+--processor-module-path parameter in jdk 9+.-processorpath parameter in jdk 1.6+.private Stringvalue of -release parameter in java 9+private booleanprivate booleanprivate booleanprivate Stringprivate Stringprivate Stringprivate booleanprivate Stringprivate File -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClasspathEntry(String classpathEntry) voidaddCompilerCustomArgument(String customArgument, String value) voidaddExclude(String exclude) voidaddInclude(String include) voidaddModulepathEntry(String modulepathEntry) voidvoidaddProcessorPathEntry(String entry) -processorpath parameter in jdk 1.6+.voidaddSourceLocation(String sourceLocation) String[]Deprecated.will be removed in 2.X use #getCustomCompilerArgumentsAsMapGet all unique argument keys and their value.In case argument keys are not unique, this will return all entriesgetProc()-processorpath parameter in jdk 1.6+.booleanisDebug()booleanbooleanbooleanbooleanisFork()booleanbooleanbooleanbooleanbooleanbooleanvoidsetAnnotationProcessors(String[] annotationProcessors) voidsetBuildDirectory(File buildDirectory) voidsetClasspathEntries(List<String> classpathEntries) voidsetCompilerReuseStrategy(CompilerConfiguration.CompilerReuseStrategy compilerReuseStrategy) voidsetCompilerVersion(String compilerVersion) voidsetCustomCompilerArguments(LinkedHashMap<String, String> customCompilerArguments) Deprecated.will be removed in 2.X use #setCustomCompilerArgumentsAsMapvoidsetCustomCompilerArgumentsAsMap(Map<String, String> customCompilerArguments) voidsetDebug(boolean debug) voidsetDebugFileName(String debugFileName) voidsetDebugLevel(String debugLevel) voidsetEnablePreview(boolean enablePreview) voidsetExcludes(Set<String> excludes) voidsetExecutable(String executable) voidsetFailOnWarning(boolean failOnWarnings) voidsetForceJavacCompilerUse(boolean forceJavacCompilerUse) voidsetFork(boolean fork) voidsetGeneratedSourcesDirectory(File generatedSourcesDirectory) voidsetIncludes(Set<String> includes) voidvoidsetMeminitial(String meminitial) voidsetModulepathEntries(List<String> modulepathEntries) voidsetModuleVersion(String moduleVersion) voidsetOptimize(boolean optimize) voidsetOutputFileName(String outputFileName) voidsetOutputLocation(String outputLocation) voidsetParameters(boolean parameters) voidvoidsetProcessorModulePathEntries(List<String> processorModulePathEntries) voidsetProcessorPathEntries(List<String> processorPathEntries) -processorpath parameter in jdk 1.6+.voidsetReleaseVersion(String releaseVersion) voidsetShowDeprecation(boolean showDeprecation) voidsetShowLint(boolean showLint) voidsetShowWarnings(boolean showWarnings) voidsetSourceEncoding(String sourceEncoding) voidsetSourceFiles(Set<File> sourceFiles) voidsetSourceLocations(List<String> sourceLocations) voidsetSourceVersion(String sourceVersion) voidsetTargetVersion(String targetVersion) voidsetVerbose(boolean verbose) voidsetWarnings(String warnings) voidsetWorkingDirectory(File workingDirectory)
-
Field Details
-
outputLocation
-
classpathEntries
-
modulepathEntries
-
sourceFiles
-
sourceLocations
-
includes
-
excludes
-
debug
private boolean debug -
debugLevel
-
showWarnings
private boolean showWarnings -
warnings
-
showLint
private boolean showLint -
failOnWarning
private boolean failOnWarning-Werror argument as supported since Java 1.7 -
showDeprecation
private boolean showDeprecation -
sourceVersion
-
targetVersion
-
releaseVersion
value of -release parameter in java 9+ -
sourceEncoding
-
moduleVersion
value of --module-version parameter in java 9+ -
customCompilerArguments
-
fork
private boolean fork -
optimize
private boolean optimize -
meminitial
-
maxmem
-
executable
-
workingDirectory
-
compilerVersion
-
verbose
private boolean verbose -
parameters
private boolean parameters- Since:
- 2.8.2
-
buildDirectory
A build temporary directory, eg target/. Used by the compiler implementation to put temporary files. -
outputFileName
Used to control the name of the output file when compiling a set of sources to a single file. -
generatedSourcesDirectory
in jdk 1.6+, used to hold value of the -s path parameter. -
proc
value of the -proc parameter in jdk 1.6+ -
annotationProcessors
-processor parameters in jdk 1.6+ -
processorPathEntries
-processorpath parameter in jdk 1.6+. If specified, annotation processors are only searched in the processor path. Otherwise they are searched in the classpath. -
processorModulePathEntries
--processor-module-path parameter in jdk 9+. If specified, annotation processors are only searched in the processor path. Otherwise they are searched in the modulepath. -
compilerReuseStrategy
default valueCompilerConfiguration.CompilerReuseStrategy.ReuseCreated- Since:
- 1.9
-
forceJavacCompilerUse
private boolean forceJavacCompilerUseforce usage of old JavacCompiler even if javax.tools is detected- Since:
- 2.0
-
debugFileName
force a different of the debug file containing the forked command run (such javac.sh)- Since:
- 2.9.1
-
enablePreview
private boolean enablePreviewconfigure--enable-previewof java compiler
-
-
Constructor Details
-
CompilerConfiguration
public CompilerConfiguration()
-
-
Method Details
-
setOutputLocation
-
getOutputLocation
-
addClasspathEntry
-
setClasspathEntries
-
getClasspathEntries
-
addModulepathEntry
-
setModulepathEntries
-
getModulepathEntries
-
setSourceFiles
-
getSourceFiles
-
addSourceLocation
-
setSourceLocations
-
getSourceLocations
-
addInclude
-
setIncludes
-
getIncludes
-
addExclude
-
setExcludes
-
getExcludes
-
setDebug
public void setDebug(boolean debug) -
isDebug
public boolean isDebug() -
setDebugLevel
-
getDebugLevel
-
setWarnings
-
isShowWarnings
public boolean isShowWarnings() -
setShowWarnings
public void setShowWarnings(boolean showWarnings) -
isShowDeprecation
public boolean isShowDeprecation() -
getWarnings
-
setShowLint
public void setShowLint(boolean showLint) -
isShowLint
public boolean isShowLint() -
setShowDeprecation
public void setShowDeprecation(boolean showDeprecation) -
isFailOnWarning
public boolean isFailOnWarning() -
setFailOnWarning
public void setFailOnWarning(boolean failOnWarnings) -
getSourceVersion
-
setSourceVersion
-
getTargetVersion
-
setTargetVersion
-
getReleaseVersion
-
setReleaseVersion
-
getSourceEncoding
-
setSourceEncoding
-
getModuleVersion
-
setModuleVersion
-
addCompilerCustomArgument
-
getCustomCompilerArguments
Deprecated.will be removed in 2.X use #getCustomCompilerArgumentsAsMap- Returns:
-
setCustomCompilerArguments
@Deprecated public void setCustomCompilerArguments(LinkedHashMap<String, String> customCompilerArguments) Deprecated.will be removed in 2.X use #setCustomCompilerArgumentsAsMap- Parameters:
customCompilerArguments-
-
getCustomCompilerArgumentsAsMap
Get all unique argument keys and their value. In case of duplicate keys, last one added wins.- Returns:
- See Also:
-
setCustomCompilerArgumentsAsMap
-
getCustomCompilerArgumentsEntries
In case argument keys are not unique, this will return all entries- Returns:
-
isFork
public boolean isFork() -
setFork
public void setFork(boolean fork) -
getMeminitial
-
setMeminitial
-
getMaxmem
-
setMaxmem
-
getExecutable
-
setExecutable
-
getWorkingDirectory
-
setWorkingDirectory
-
getBuildDirectory
-
setBuildDirectory
-
getOutputFileName
-
setOutputFileName
-
isOptimize
public boolean isOptimize() -
setOptimize
public void setOptimize(boolean optimize) -
getCompilerVersion
-
setCompilerVersion
-
isVerbose
public boolean isVerbose() -
setVerbose
public void setVerbose(boolean verbose) -
isParameters
public boolean isParameters() -
setParameters
public void setParameters(boolean parameters) -
isEnablePreview
public boolean isEnablePreview() -
setEnablePreview
public void setEnablePreview(boolean enablePreview) -
setProc
-
setGeneratedSourcesDirectory
-
getGeneratedSourcesDirectory
-
getProc
-
setAnnotationProcessors
-
getAnnotationProcessors
-
addProcessorPathEntry
-processorpath parameter in jdk 1.6+. If specified, annotation processors are only searched in the processor path. Otherwise they are searched in the classpath.- Parameters:
entry- processor path entry to add
-
getProcessorPathEntries
-processorpath parameter in jdk 1.6+. If specified, annotation processors are only searched in the processor path. Otherwise they are searched in the classpath.- Returns:
- the processorPathEntries
-
setProcessorPathEntries
-processorpath parameter in jdk 1.6+. If specified, annotation processors are only searched in the processor path. Otherwise they are searched in the classpath.- Parameters:
processorPathEntries- the processorPathEntries to set
-
addProcessorModulePathEntry
-
getProcessorModulePathEntries
-
setProcessorModulePathEntries
-
getCompilerReuseStrategy
-
setCompilerReuseStrategy
public void setCompilerReuseStrategy(CompilerConfiguration.CompilerReuseStrategy compilerReuseStrategy) -
getDebugFileName
-
setDebugFileName
-
isForceJavacCompilerUse
public boolean isForceJavacCompilerUse() -
setForceJavacCompilerUse
public void setForceJavacCompilerUse(boolean forceJavacCompilerUse)
-