org.apache.maven.plugin
Class AbstractCompilerMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.AbstractCompilerMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
CompilerMojo, TestCompilerMojo

public abstract class AbstractCompilerMojo
extends org.apache.maven.plugin.AbstractMojo

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.

Since:
2.0
Version:
$Id: AbstractCompilerMojo.java 990573 2010-08-29 12:12:21Z bentmann $
Author:
others, Trygve Laugstøl

Field Summary
protected  java.lang.String compilerArgument
           Sets the unformatted argument string to be passed to the compiler if fork is set to true.
protected  java.util.Map<java.lang.String,java.lang.String> compilerArguments
           Sets the arguments to be passed to the compiler (prepending a dash) if fork is set to true.
protected  java.lang.String source
          The -source argument for the Java compiler.
protected  java.lang.String target
          The -target argument for the Java compiler.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractCompilerMojo()
           
 
Method Summary
 void execute()
           
protected abstract  java.util.List<java.lang.String> getClasspathElements()
           
protected abstract  java.lang.String getCompilerArgument()
           
protected abstract  java.util.Map<java.lang.String,java.lang.String> getCompilerArguments()
           
protected abstract  java.util.List<java.lang.String> getCompileSourceRoots()
           
protected abstract  java.io.File getGeneratedSourcesDirectory()
           
protected abstract  java.io.File getOutputDirectory()
           
protected abstract  java.lang.String getSource()
           
protected abstract  org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(int staleMillis)
           
protected abstract  org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(java.lang.String inputFileEnding)
           
protected abstract  java.lang.String getTarget()
           
 
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

source

protected java.lang.String source
The -source argument for the Java compiler.


target

protected java.lang.String target
The -target argument for the Java compiler.


compilerArguments

protected java.util.Map<java.lang.String,java.lang.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.

Since:
2.0.1

compilerArgument

protected java.lang.String compilerArgument

Sets the unformatted argument string to be passed to the compiler 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.

Constructor Detail

AbstractCompilerMojo

public AbstractCompilerMojo()
Method Detail

getSourceInclusionScanner

protected abstract org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(int staleMillis)

getSourceInclusionScanner

protected abstract org.codehaus.plexus.compiler.util.scan.SourceInclusionScanner getSourceInclusionScanner(java.lang.String inputFileEnding)

getClasspathElements

protected abstract java.util.List<java.lang.String> getClasspathElements()

getCompileSourceRoots

protected abstract java.util.List<java.lang.String> getCompileSourceRoots()

getOutputDirectory

protected abstract java.io.File getOutputDirectory()

getSource

protected abstract java.lang.String getSource()

getTarget

protected abstract java.lang.String getTarget()

getCompilerArgument

protected abstract java.lang.String getCompilerArgument()

getCompilerArguments

protected abstract java.util.Map<java.lang.String,java.lang.String> getCompilerArguments()

getGeneratedSourcesDirectory

protected abstract java.io.File getGeneratedSourcesDirectory()

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    CompilationFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
CompilationFailureException


Copyright © 2001-2011 Apache Software Foundation. All Rights Reserved.