| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.apache.maven.plugin.compiler.AbstractCompilerMojo
public abstract class AbstractCompilerMojo
TODO: At least one step could be optimized, currently the plugin will do two scans of all the source code if the compiler has to have the entire set of sources. This is currently the case for at least the C# compiler and most likely all the other .NET compilers too.
| Field Summary | |
|---|---|
| protected  String | compilerArgumentSets the unformatted single argument string to be passed to the compiler if forkis set totrue. | 
| protected  Map<String,String> | compilerArgumentsSets the arguments to be passed to the compiler (prepending a dash) if forkis set totrue. | 
| protected  MavenSession | mavenSessionWe need this to determine the start timestamp of the build. | 
| protected  String | sourceThe -source argument for the Java compiler. | 
| protected  String | targetThe -target argument for the Java compiler. | 
| Fields inherited from interface org.apache.maven.plugin.Mojo | 
|---|
| ROLE | 
| Constructor Summary | |
|---|---|
| AbstractCompilerMojo() | |
| Method Summary | |
|---|---|
| protected  CompilerResult | convertToCompilerResult(List<CompilerError> compilerErrors) | 
|  void | execute() | 
| protected  Date | getBuildStartTime() | 
| protected abstract  List<String> | getClasspathElements() | 
| protected abstract  String | getCompilerArgument() | 
| protected abstract  Map<String,String> | getCompilerArguments() | 
| protected abstract  List<String> | getCompileSourceRoots() | 
| protected abstract  File | getGeneratedSourcesDirectory() | 
| protected abstract  File | getOutputDirectory() | 
| protected  int | getRequestThreadCount()try to get thread count if a Maven 3 build, using reflection as the plugin must not be maven3 api dependant | 
| protected abstract  String | getSource() | 
| protected abstract  SourceInclusionScanner | getSourceInclusionScanner(int staleMillis) | 
| protected abstract  SourceInclusionScanner | getSourceInclusionScanner(String inputFileEnding) | 
| protected abstract  String | getTarget() | 
| protected  boolean | isDependencyChanged()We just compare the timestamps of all local dependency files (inter-module dependency classpath) and the own generated classes and if we got a file which is >= the buid-started timestamp, then we catched a file which got changed during this build. | 
| Methods inherited from class org.apache.maven.plugin.AbstractMojo | 
|---|
| getLog, getPluginContext, setLog, setPluginContext | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
@Parameter(property="maven.compiler.source",
           defaultValue="1.5")
protected String source
@Parameter(property="maven.compiler.target",
           defaultValue="1.5")
protected String target
@Parameter protected Map<String,String> compilerArguments
 Sets the arguments to be passed to the compiler (prepending a dash) if fork is set to true.
 
This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.
 To pass -Xmaxerrs 1000 -Xlint -Xlint:-path -Averbose=true you should include the following:
 
<compilerArguments> <Xmaxerrs>1000</Xmaxerrs> <Xlint/> <Xlint:-path/> <Averbose>true</Averbose> </compilerArguments>
@Parameter protected String compilerArgument
 Sets the unformatted single argument string to be passed to the compiler if fork is set to true.
 To pass multiple arguments such as -Xmaxerrs 1000 (which are actually two arguments) you have to use compilerArguments.
 
This is because the list of valid arguments passed to a Java compiler varies based on the compiler version.
@Component protected MavenSession mavenSession
| Constructor Detail | 
|---|
public AbstractCompilerMojo()
| Method Detail | 
|---|
protected abstract SourceInclusionScanner getSourceInclusionScanner(int staleMillis)
protected abstract SourceInclusionScanner getSourceInclusionScanner(String inputFileEnding)
protected abstract List<String> getClasspathElements()
protected abstract List<String> getCompileSourceRoots()
protected abstract File getOutputDirectory()
protected abstract String getSource()
protected abstract String getTarget()
protected abstract String getCompilerArgument()
protected abstract Map<String,String> getCompilerArguments()
protected abstract File getGeneratedSourcesDirectory()
public void execute()
             throws MojoExecutionException,
                    CompilationFailureException
MojoExecutionException
CompilationFailureExceptionprotected CompilerResult convertToCompilerResult(List<CompilerError> compilerErrors)
protected int getRequestThreadCount()
protected Date getBuildStartTime()
protected boolean isDependencyChanged()
true if at least one single dependency has changed.| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||