org.codehaus.gmaven.plugin.stubgen
Class AbstractGenerateStubsMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.gmaven.plugin.MojoSupport
          extended by org.codehaus.gmaven.plugin.ProviderMojoSupport
              extended by org.codehaus.gmaven.plugin.ComponentMojoSupport
                  extended by org.codehaus.gmaven.plugin.CompilerMojoSupport
                      extended by org.codehaus.gmaven.plugin.stubgen.AbstractGenerateStubsMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
GenerateStubsMojo, GenerateTestStubsMojo

public abstract class AbstractGenerateStubsMojo
extends CompilerMojoSupport

Support for Java stub generation mojos.

Stub generation basically parses Groovy sources, and then creates the bare-minimum Java source equivilent so that the maven-compiler-plugin's compile and testCompile goals can execute and resolve Groovy classes that may be referenced by Java sources.

This is important, since our compile and testCompile goals execute *after* the normal Java compiler does.

Version:
$Id: AbstractGenerateStubsMojo.java 49 2009-10-16 14:03:56Z user57 $
Author:
Jason Dillon, Jason Smith

Field Summary
 
Fields inherited from class org.codehaus.gmaven.plugin.CompilerMojoSupport
classpath, compileState, sources
 
Fields inherited from class org.codehaus.gmaven.plugin.ProviderMojoSupport
pluginArtifactMap
 
Fields inherited from class org.codehaus.gmaven.plugin.MojoSupport
artifactFactory, artifactMetadataSource, artifactRepository, artifactResolver, log, project, remoteRepositories
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
protected AbstractGenerateStubsMojo()
           
 
Method Summary
protected  void compile(StubCompiler compiler, org.apache.maven.shared.model.fileset.FileSet[] sources)
           
 void execute()
          Main Mojo execution hook.
protected abstract  void forceCompile(File file)
           
protected  void process(Component component)
           
 
Methods inherited from class org.codehaus.gmaven.plugin.CompilerMojoSupport
addSourceRoot, getDefaultSources, getExcludesFrom, getIncludesFrom, getOutputDirectory, getSourceRoots, getUserClassspathElements, scanForSources, scanForSources
 
Methods inherited from class org.codehaus.gmaven.plugin.ComponentMojoSupport
configure, doExecute, feature, feature
 
Methods inherited from class org.codehaus.gmaven.plugin.ProviderMojoSupport
detectCompatibleProvider, getProviderManager, getProviderSelection, provider
 
Methods inherited from class org.codehaus.gmaven.plugin.MojoSupport
createArtifact, createClassPath, getArtifact, getProjectClasspathElements, resolveArtifact
 
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
 

Constructor Detail

AbstractGenerateStubsMojo

protected AbstractGenerateStubsMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Description copied from class: MojoSupport
Main Mojo execution hook. Sub-class should use MojoSupport.doExecute() instead.

Specified by:
execute in interface org.apache.maven.plugin.Mojo
Overrides:
execute in class MojoSupport
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

forceCompile

protected abstract void forceCompile(File file)

process

protected void process(Component component)
                throws Exception
Specified by:
process in class ComponentMojoSupport
Throws:
Exception

compile

protected void compile(StubCompiler compiler,
                       org.apache.maven.shared.model.fileset.FileSet[] sources)
                throws Exception
Throws:
Exception


Copyright © 2006-2012 Codehaus. All Rights Reserved.