org.codehaus.mojo.gwt
Class AbstractGwtMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.gwt.AbstractGwtMojo
All Implemented Interfaces:
ContextEnabled, Mojo
Direct Known Subclasses:
AbstractGwtModuleMojo, GenerateAsyncMojo

public abstract class AbstractGwtMojo
extends AbstractMojo

Abstract Support class for all GWT-related operations.

Provide methods to build classpath for GWT SDK tools.

Version:
$Id: AbstractGwtMojo.java 13242 2010-11-29 16:12:27Z olamy $
Author:
Nicolas De Loof

Field Summary
protected  ArtifactFactory artifactFactory
           
protected  ClasspathBuilder classpathBuilder
           
static String GWT_GROUP_ID
          GWT artifacts groupId
protected  boolean gwtSdkFirstInClasspath
          The forked command line will use gwt sdk jars first in classpath.
protected  ArtifactRepository localRepository
           
protected  List<ArtifactRepository> remoteRepositories
           
protected  ArtifactResolver resolver
           
protected  File warSourceDirectory
          Location of the web application static resources (same as maven-war-plugin parameter)
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractGwtMojo()
           
 
Method Summary
protected  int addClasspathElements(Collection<?> elements, URL[] urls, int startPosition)
          Add classpath elements to a classpath URL set
protected  void addCompileSourceRoot(File path)
           
 Collection<File> getClasspath(String scope)
          Build the GWT classpath for the specified scope
 File getGenerateDirectory()
           
protected  File getGwtDevJar()
           
protected  File getGwtUserJar()
           
 ArtifactRepository getLocalRepository()
           
 File getOutputDirectory()
           
 MavenProject getProject()
           
 Set<Artifact> getProjectArtifacts()
           
 List<ArtifactRepository> getRemoteRepositories()
           
protected  Artifact resolve(String groupId, String artifactId, String version, String type, String classifier)
           
 
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
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

GWT_GROUP_ID

public static final String GWT_GROUP_ID
GWT artifacts groupId

See Also:
Constant Field Values

resolver

protected ArtifactResolver resolver
Is a Plexus component defined by:

artifactFactory

protected ArtifactFactory artifactFactory
Is a Plexus component defined by:

classpathBuilder

protected ClasspathBuilder classpathBuilder
Is a Plexus component defined by:

localRepository

protected ArtifactRepository localRepository
Is defined by:
expression:
${localRepository}
Is required.
Is readonly.

remoteRepositories

protected List<ArtifactRepository> remoteRepositories
Is defined by:
expression:
${project.remoteArtifactRepositories}
Is required.
Is readonly.

warSourceDirectory

protected File warSourceDirectory
Location of the web application static resources (same as maven-war-plugin parameter)

Is defined by:
default-value:
${basedir}/src/main/webapp

gwtSdkFirstInClasspath

protected boolean gwtSdkFirstInClasspath
The forked command line will use gwt sdk jars first in classpath. see issue http://code.google.com/p/google-web-toolkit/issues/detail?id=5290

Since:
2.1.0-1
Is defined by:
expression:
${gwt.gwtSdkFirstInClasspath}
default-value:
false
Constructor Detail

AbstractGwtMojo

public AbstractGwtMojo()
Method Detail

getOutputDirectory

public File getOutputDirectory()

addClasspathElements

protected int addClasspathElements(Collection<?> elements,
                                   URL[] urls,
                                   int startPosition)
                            throws MojoExecutionException
Add classpath elements to a classpath URL set

Parameters:
elements - the initial URL set
urls - the urls to add
startPosition - the position to insert URLS
Returns:
full classpath URL set
Throws:
MojoExecutionException - some error occured

getClasspath

public Collection<File> getClasspath(String scope)
                              throws MojoExecutionException
Build the GWT classpath for the specified scope

Parameters:
scope - Artifact.SCOPE_COMPILE or Artifact.SCOPE_TEST
Returns:
a collection of dependencies as Files for the specified scope.
Throws:
MojoExecutionException - if classPath building failed

getGwtDevJar

protected File getGwtDevJar()
                     throws IOException
Throws:
IOException

getGwtUserJar

protected File getGwtUserJar()
                      throws IOException
Throws:
IOException

resolve

protected Artifact resolve(String groupId,
                           String artifactId,
                           String version,
                           String type,
                           String classifier)
                    throws MojoExecutionException
Throws:
MojoExecutionException

addCompileSourceRoot

protected void addCompileSourceRoot(File path)
Parameters:
path - file to add to the project compile directories

getProject

public MavenProject getProject()
Returns:
the project

getLocalRepository

public ArtifactRepository getLocalRepository()

getRemoteRepositories

public List<ArtifactRepository> getRemoteRepositories()

getGenerateDirectory

public File getGenerateDirectory()

getProjectArtifacts

public Set<Artifact> getProjectArtifacts()


Copyright © 2007-2012 Codehaus. All Rights Reserved.