Package org.codehaus.plexus.compiler
Class CompilerConfiguration
- java.lang.Object
-
- org.codehaus.plexus.compiler.CompilerConfiguration
-
public class CompilerConfiguration extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CompilerConfiguration.CompilerReuseStrategy
Re-use strategy of the compiler (implement for java only).
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
annotationProcessors
-processor parameters in jdk 1.6+private java.io.File
buildDirectory
A build temporary directory, eg target/.private java.util.List<java.lang.String>
classpathEntries
private CompilerConfiguration.CompilerReuseStrategy
compilerReuseStrategy
default valueCompilerConfiguration.CompilerReuseStrategy.ReuseCreated
private java.lang.String
compilerVersion
private java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>>
customCompilerArguments
private boolean
debug
private java.lang.String
debugLevel
private java.util.Set<java.lang.String>
excludes
private java.lang.String
executable
private boolean
failOnWarning
-Werror argument as supported since Java 1.7private boolean
forceJavacCompilerUse
force usage of old JavacCompiler even if javax.tools is detectedprivate boolean
fork
private java.io.File
generatedSourcesDirectory
in jdk 1.6+, used to hold value of the -s path parameter.private java.util.Set<java.lang.String>
includes
private java.lang.String
maxmem
private java.lang.String
meminitial
private java.util.List<java.lang.String>
modulepathEntries
private java.lang.String
moduleVersion
value of --module-version parameter in java 9+private boolean
optimize
private java.lang.String
outputFileName
Used to control the name of the output file when compiling a set of sources to a single file.private java.lang.String
outputLocation
private boolean
parameters
private java.lang.String
proc
value of the -proc parameter in jdk 1.6+private java.util.List<java.lang.String>
processorPathEntries
-processorpath parameter in jdk 1.6+.private java.lang.String
releaseVersion
value of -release parameter in java 9+private boolean
showDeprecation
private boolean
showWarnings
private java.lang.String
sourceEncoding
private java.util.Set<java.io.File>
sourceFiles
private java.util.List<java.lang.String>
sourceLocations
private java.lang.String
sourceVersion
private java.lang.String
targetVersion
private boolean
verbose
private java.io.File
workingDirectory
-
Constructor Summary
Constructors Constructor Description CompilerConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addClasspathEntry(java.lang.String classpathEntry)
void
addCompilerCustomArgument(java.lang.String customArgument, java.lang.String value)
void
addExclude(java.lang.String exclude)
void
addInclude(java.lang.String include)
void
addModulepathEntry(java.lang.String modulepathEntry)
void
addProcessorPathEntry(java.lang.String entry)
-processorpath parameter in jdk 1.6+.void
addSourceLocation(java.lang.String sourceLocation)
java.lang.String[]
getAnnotationProcessors()
java.io.File
getBuildDirectory()
java.util.List<java.lang.String>
getClasspathEntries()
CompilerConfiguration.CompilerReuseStrategy
getCompilerReuseStrategy()
java.lang.String
getCompilerVersion()
java.util.LinkedHashMap<java.lang.String,java.lang.String>
getCustomCompilerArguments()
Deprecated.will be removed in 2.X use #getCustomCompilerArgumentsAsMapjava.util.Map<java.lang.String,java.lang.String>
getCustomCompilerArgumentsAsMap()
Get all unique argument keys and their value.java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>>
getCustomCompilerArgumentsEntries()
In case argument keys are not unique, this will return all entriesjava.lang.String
getDebugLevel()
java.util.Set<java.lang.String>
getExcludes()
java.lang.String
getExecutable()
java.io.File
getGeneratedSourcesDirectory()
java.util.Set<java.lang.String>
getIncludes()
java.lang.String
getMaxmem()
java.lang.String
getMeminitial()
java.util.List<java.lang.String>
getModulepathEntries()
java.lang.String
getModuleVersion()
java.lang.String
getOutputFileName()
java.lang.String
getOutputLocation()
java.lang.String
getProc()
java.util.List<java.lang.String>
getProcessorPathEntries()
-processorpath parameter in jdk 1.6+.java.lang.String
getReleaseVersion()
java.lang.String
getSourceEncoding()
java.util.Set<java.io.File>
getSourceFiles()
java.util.List<java.lang.String>
getSourceLocations()
java.lang.String
getSourceVersion()
java.lang.String
getTargetVersion()
java.io.File
getWorkingDirectory()
boolean
isDebug()
boolean
isFailOnWarning()
boolean
isForceJavacCompilerUse()
boolean
isFork()
boolean
isOptimize()
boolean
isParameters()
boolean
isShowDeprecation()
boolean
isShowWarnings()
boolean
isVerbose()
void
setAnnotationProcessors(java.lang.String[] annotationProcessors)
void
setBuildDirectory(java.io.File buildDirectory)
void
setClasspathEntries(java.util.List<java.lang.String> classpathEntries)
void
setCompilerReuseStrategy(CompilerConfiguration.CompilerReuseStrategy compilerReuseStrategy)
void
setCompilerVersion(java.lang.String compilerVersion)
void
setCustomCompilerArguments(java.util.LinkedHashMap<java.lang.String,java.lang.String> customCompilerArguments)
Deprecated.will be removed in 2.X use #setCustomCompilerArgumentsAsMapvoid
setCustomCompilerArgumentsAsMap(java.util.Map<java.lang.String,java.lang.String> customCompilerArguments)
void
setDebug(boolean debug)
void
setDebugLevel(java.lang.String debugLevel)
void
setExcludes(java.util.Set<java.lang.String> excludes)
void
setExecutable(java.lang.String executable)
void
setFailOnWarning(boolean failOnWarnings)
void
setForceJavacCompilerUse(boolean forceJavacCompilerUse)
void
setFork(boolean fork)
void
setGeneratedSourcesDirectory(java.io.File generatedSourcesDirectory)
void
setIncludes(java.util.Set<java.lang.String> includes)
void
setMaxmem(java.lang.String maxmem)
void
setMeminitial(java.lang.String meminitial)
void
setModulepathEntries(java.util.List<java.lang.String> modulepathEntries)
void
setModuleVersion(java.lang.String moduleVersion)
void
setOptimize(boolean optimize)
void
setOutputFileName(java.lang.String outputFileName)
void
setOutputLocation(java.lang.String outputLocation)
void
setParameters(boolean parameters)
void
setProc(java.lang.String proc)
void
setProcessorPathEntries(java.util.List<java.lang.String> processorPathEntries)
-processorpath parameter in jdk 1.6+.void
setReleaseVersion(java.lang.String releaseVersion)
void
setShowDeprecation(boolean showDeprecation)
void
setShowWarnings(boolean showWarnings)
void
setSourceEncoding(java.lang.String sourceEncoding)
void
setSourceFiles(java.util.Set<java.io.File> sourceFiles)
void
setSourceLocations(java.util.List<java.lang.String> sourceLocations)
void
setSourceVersion(java.lang.String sourceVersion)
void
setTargetVersion(java.lang.String targetVersion)
void
setVerbose(boolean verbose)
void
setWorkingDirectory(java.io.File workingDirectory)
-
-
-
Field Detail
-
outputLocation
private java.lang.String outputLocation
-
classpathEntries
private java.util.List<java.lang.String> classpathEntries
-
modulepathEntries
private java.util.List<java.lang.String> modulepathEntries
-
sourceFiles
private java.util.Set<java.io.File> sourceFiles
-
sourceLocations
private java.util.List<java.lang.String> sourceLocations
-
includes
private java.util.Set<java.lang.String> includes
-
excludes
private java.util.Set<java.lang.String> excludes
-
debug
private boolean debug
-
debugLevel
private java.lang.String debugLevel
-
showWarnings
private boolean showWarnings
-
failOnWarning
private boolean failOnWarning
-Werror argument as supported since Java 1.7
-
showDeprecation
private boolean showDeprecation
-
sourceVersion
private java.lang.String sourceVersion
-
targetVersion
private java.lang.String targetVersion
-
releaseVersion
private java.lang.String releaseVersion
value of -release parameter in java 9+
-
sourceEncoding
private java.lang.String sourceEncoding
-
moduleVersion
private java.lang.String moduleVersion
value of --module-version parameter in java 9+
-
customCompilerArguments
private java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> customCompilerArguments
-
fork
private boolean fork
-
optimize
private boolean optimize
-
meminitial
private java.lang.String meminitial
-
maxmem
private java.lang.String maxmem
-
executable
private java.lang.String executable
-
workingDirectory
private java.io.File workingDirectory
-
compilerVersion
private java.lang.String compilerVersion
-
verbose
private boolean verbose
-
parameters
private boolean parameters
- Since:
- 2.8.2
-
buildDirectory
private java.io.File buildDirectory
A build temporary directory, eg target/. Used by the compiler implementation to put temporary files.
-
outputFileName
private java.lang.String outputFileName
Used to control the name of the output file when compiling a set of sources to a single file.
-
generatedSourcesDirectory
private java.io.File generatedSourcesDirectory
in jdk 1.6+, used to hold value of the -s path parameter.
-
proc
private java.lang.String proc
value of the -proc parameter in jdk 1.6+
-
annotationProcessors
private java.lang.String[] annotationProcessors
-processor parameters in jdk 1.6+
-
processorPathEntries
private java.util.List<java.lang.String> 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.
-
compilerReuseStrategy
private CompilerConfiguration.CompilerReuseStrategy compilerReuseStrategy
default valueCompilerConfiguration.CompilerReuseStrategy.ReuseCreated
- Since:
- 1.9
-
forceJavacCompilerUse
private boolean forceJavacCompilerUse
force usage of old JavacCompiler even if javax.tools is detected- Since:
- 2.0
-
-
Method Detail
-
setOutputLocation
public void setOutputLocation(java.lang.String outputLocation)
-
getOutputLocation
public java.lang.String getOutputLocation()
-
addClasspathEntry
public void addClasspathEntry(java.lang.String classpathEntry)
-
setClasspathEntries
public void setClasspathEntries(java.util.List<java.lang.String> classpathEntries)
-
getClasspathEntries
public java.util.List<java.lang.String> getClasspathEntries()
-
addModulepathEntry
public void addModulepathEntry(java.lang.String modulepathEntry)
-
setModulepathEntries
public void setModulepathEntries(java.util.List<java.lang.String> modulepathEntries)
-
getModulepathEntries
public java.util.List<java.lang.String> getModulepathEntries()
-
setSourceFiles
public void setSourceFiles(java.util.Set<java.io.File> sourceFiles)
-
getSourceFiles
public java.util.Set<java.io.File> getSourceFiles()
-
addSourceLocation
public void addSourceLocation(java.lang.String sourceLocation)
-
setSourceLocations
public void setSourceLocations(java.util.List<java.lang.String> sourceLocations)
-
getSourceLocations
public java.util.List<java.lang.String> getSourceLocations()
-
addInclude
public void addInclude(java.lang.String include)
-
setIncludes
public void setIncludes(java.util.Set<java.lang.String> includes)
-
getIncludes
public java.util.Set<java.lang.String> getIncludes()
-
addExclude
public void addExclude(java.lang.String exclude)
-
setExcludes
public void setExcludes(java.util.Set<java.lang.String> excludes)
-
getExcludes
public java.util.Set<java.lang.String> getExcludes()
-
setDebug
public void setDebug(boolean debug)
-
isDebug
public boolean isDebug()
-
setDebugLevel
public void setDebugLevel(java.lang.String debugLevel)
-
getDebugLevel
public java.lang.String getDebugLevel()
-
setShowWarnings
public void setShowWarnings(boolean showWarnings)
-
isShowWarnings
public boolean isShowWarnings()
-
isShowDeprecation
public boolean isShowDeprecation()
-
setShowDeprecation
public void setShowDeprecation(boolean showDeprecation)
-
isFailOnWarning
public boolean isFailOnWarning()
-
setFailOnWarning
public void setFailOnWarning(boolean failOnWarnings)
-
getSourceVersion
public java.lang.String getSourceVersion()
-
setSourceVersion
public void setSourceVersion(java.lang.String sourceVersion)
-
getTargetVersion
public java.lang.String getTargetVersion()
-
setTargetVersion
public void setTargetVersion(java.lang.String targetVersion)
-
getReleaseVersion
public java.lang.String getReleaseVersion()
-
setReleaseVersion
public void setReleaseVersion(java.lang.String releaseVersion)
-
getSourceEncoding
public java.lang.String getSourceEncoding()
-
setSourceEncoding
public void setSourceEncoding(java.lang.String sourceEncoding)
-
getModuleVersion
public java.lang.String getModuleVersion()
-
setModuleVersion
public void setModuleVersion(java.lang.String moduleVersion)
-
addCompilerCustomArgument
public void addCompilerCustomArgument(java.lang.String customArgument, java.lang.String value)
-
getCustomCompilerArguments
@Deprecated public java.util.LinkedHashMap<java.lang.String,java.lang.String> getCustomCompilerArguments()
Deprecated.will be removed in 2.X use #getCustomCompilerArgumentsAsMap- Returns:
-
setCustomCompilerArguments
@Deprecated public void setCustomCompilerArguments(java.util.LinkedHashMap<java.lang.String,java.lang.String> customCompilerArguments)
Deprecated.will be removed in 2.X use #setCustomCompilerArgumentsAsMap- Parameters:
customCompilerArguments
-
-
getCustomCompilerArgumentsAsMap
public java.util.Map<java.lang.String,java.lang.String> getCustomCompilerArgumentsAsMap()
Get all unique argument keys and their value. In case of duplicate keys, last one added wins.- Returns:
- See Also:
getCustomCompilerArgumentsEntries()
-
setCustomCompilerArgumentsAsMap
public void setCustomCompilerArgumentsAsMap(java.util.Map<java.lang.String,java.lang.String> customCompilerArguments)
-
getCustomCompilerArgumentsEntries
public java.util.Collection<java.util.Map.Entry<java.lang.String,java.lang.String>> 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
public java.lang.String getMeminitial()
-
setMeminitial
public void setMeminitial(java.lang.String meminitial)
-
getMaxmem
public java.lang.String getMaxmem()
-
setMaxmem
public void setMaxmem(java.lang.String maxmem)
-
getExecutable
public java.lang.String getExecutable()
-
setExecutable
public void setExecutable(java.lang.String executable)
-
getWorkingDirectory
public java.io.File getWorkingDirectory()
-
setWorkingDirectory
public void setWorkingDirectory(java.io.File workingDirectory)
-
getBuildDirectory
public java.io.File getBuildDirectory()
-
setBuildDirectory
public void setBuildDirectory(java.io.File buildDirectory)
-
getOutputFileName
public java.lang.String getOutputFileName()
-
setOutputFileName
public void setOutputFileName(java.lang.String outputFileName)
-
isOptimize
public boolean isOptimize()
-
setOptimize
public void setOptimize(boolean optimize)
-
getCompilerVersion
public java.lang.String getCompilerVersion()
-
setCompilerVersion
public void setCompilerVersion(java.lang.String compilerVersion)
-
isVerbose
public boolean isVerbose()
-
setVerbose
public void setVerbose(boolean verbose)
-
isParameters
public boolean isParameters()
-
setParameters
public void setParameters(boolean parameters)
-
setProc
public void setProc(java.lang.String proc)
-
setGeneratedSourcesDirectory
public void setGeneratedSourcesDirectory(java.io.File generatedSourcesDirectory)
-
getGeneratedSourcesDirectory
public java.io.File getGeneratedSourcesDirectory()
-
getProc
public java.lang.String getProc()
-
setAnnotationProcessors
public void setAnnotationProcessors(java.lang.String[] annotationProcessors)
-
getAnnotationProcessors
public java.lang.String[] getAnnotationProcessors()
-
addProcessorPathEntry
public void addProcessorPathEntry(java.lang.String entry)
-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
public java.util.List<java.lang.String> 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
public void setProcessorPathEntries(java.util.List<java.lang.String> 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.- Parameters:
processorPathEntries
- the processorPathEntries to set
-
getCompilerReuseStrategy
public CompilerConfiguration.CompilerReuseStrategy getCompilerReuseStrategy()
-
setCompilerReuseStrategy
public void setCompilerReuseStrategy(CompilerConfiguration.CompilerReuseStrategy compilerReuseStrategy)
-
isForceJavacCompilerUse
public boolean isForceJavacCompilerUse()
-
setForceJavacCompilerUse
public void setForceJavacCompilerUse(boolean forceJavacCompilerUse)
-
-