Package org.codehaus.mojo.gwt
Class AbstractGwtMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.gwt.AbstractGwtMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractGwtModuleMojo,GenerateAsyncMojo
public abstract class AbstractGwtMojo extends org.apache.maven.plugin.AbstractMojoAbstract Support class for all GWT-related operations.Provide methods to build classpath for GWT SDK tools.
- Version:
- $Id$
- Author:
- Nicolas De Loof
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.maven.artifact.factory.ArtifactFactoryartifactFactoryprotected org.apache.maven.artifact.metadata.ArtifactMetadataSourceartifactMetadataSourceprotected ClasspathBuilderclasspathBuilderstatic java.lang.StringGWT_GROUP_IDGWT artifacts groupIdprotected booleangwtSdkFirstInClasspathDeprecated.tweak your dependencies and/or split your project with a client-only moduleprotected org.apache.maven.artifact.repository.ArtifactRepositorylocalRepositoryprotected java.lang.StringmodulePathPrefixPrefix to prepend to module names insidewebappDirectoryor in URLs in DevMode.protected java.util.List<org.apache.maven.artifact.repository.ArtifactRepository>remoteRepositoriesprotected org.apache.maven.artifact.resolver.ArtifactResolverresolverstatic java.lang.StringVAADIN_GROUP_IDprotected java.io.FilewarSourceDirectoryLocation of the web application static resources (same as maven-war-plugin parameter)
-
Constructor Summary
Constructors Constructor Description AbstractGwtMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intaddClasspathElements(java.util.Collection<?> elements, java.net.URL[] urls, int startPosition)Add classpath elements to a classpath URL setprotected voidaddCompileSourceRoot(java.io.File path)protected org.apache.maven.artifact.ArtifactgetArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String classifier)java.util.Collection<java.io.File>getClasspath(java.lang.String scope)Build the GWT classpath for the specified scopejava.io.FilegetGenerateDirectory()protected java.util.Collection<java.io.File>getGwtDevJar()protected java.util.Collection<java.io.File>getGwtUserJar()protected java.util.Collection<java.io.File>getJarAndDependencies(java.lang.String artifactId)org.apache.maven.artifact.repository.ArtifactRepositorygetLocalRepository()java.io.FilegetOutputDirectory()org.apache.maven.project.MavenProjectgetProject()java.util.Set<org.apache.maven.artifact.Artifact>getProjectArtifacts()java.util.Set<org.apache.maven.artifact.Artifact>getProjectRuntimeArtifacts()java.util.List<org.apache.maven.artifact.repository.ArtifactRepository>getRemoteRepositories()protected booleanisGenerator()Whether to use processed resources and compiled classes (false), or raw resources (true).protected org.apache.maven.artifact.Artifactresolve(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, java.lang.String classifier)protected java.io.FilesetupGenerateDirectory()-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
GWT_GROUP_ID
public static final java.lang.String GWT_GROUP_ID
GWT artifacts groupId- See Also:
- Constant Field Values
-
VAADIN_GROUP_ID
public static final java.lang.String VAADIN_GROUP_ID
- See Also:
- Constant Field Values
-
resolver
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
-
artifactFactory
@Component protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
-
classpathBuilder
@Component protected ClasspathBuilder classpathBuilder
-
localRepository
@Parameter(defaultValue="${localRepository}", required=true, readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
-
remoteRepositories
@Parameter(defaultValue="${project.remoteArtifactRepositories}", required=true, readonly=true) protected java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
-
artifactMetadataSource
@Component protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
-
modulePathPrefix
@Parameter(property="gwt.modulePathPrefix") protected java.lang.String modulePathPrefix
Prefix to prepend to module names insidewebappDirectoryor in URLs in DevMode.Could also be seen as a suffix to
webappDirectory.
-
warSourceDirectory
@Parameter(defaultValue="${basedir}/src/main/webapp") protected java.io.File warSourceDirectoryLocation of the web application static resources (same as maven-war-plugin parameter)
-
gwtSdkFirstInClasspath
@Deprecated @Parameter(defaultValue="false", property="gwt.gwtSdkFirstInClasspath") protected boolean gwtSdkFirstInClasspathDeprecated.tweak your dependencies and/or split your project with a client-only moduleThe 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
-
-
Method Detail
-
getOutputDirectory
public java.io.File getOutputDirectory()
-
addClasspathElements
protected int addClasspathElements(java.util.Collection<?> elements, java.net.URL[] urls, int startPosition) throws org.apache.maven.plugin.MojoExecutionExceptionAdd classpath elements to a classpath URL set- Parameters:
elements- the initial URL seturls- the urls to addstartPosition- the position to insert URLS- Returns:
- full classpath URL set
- Throws:
org.apache.maven.plugin.MojoExecutionException- some error occured
-
getClasspath
public java.util.Collection<java.io.File> getClasspath(java.lang.String scope) throws org.apache.maven.plugin.MojoExecutionExceptionBuild 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:
org.apache.maven.plugin.MojoExecutionException- if classPath building failed
-
isGenerator
protected boolean isGenerator()
Whether to use processed resources and compiled classes (false), or raw resources (true).
-
getGwtDevJar
protected java.util.Collection<java.io.File> getGwtDevJar() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getGwtUserJar
protected java.util.Collection<java.io.File> getGwtUserJar() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getJarAndDependencies
protected java.util.Collection<java.io.File> getJarAndDependencies(java.lang.String artifactId) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getArtifact
protected org.apache.maven.artifact.Artifact getArtifact(java.lang.String groupId, java.lang.String artifactId, java.lang.String classifier)
-
resolve
protected org.apache.maven.artifact.Artifact resolve(java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String type, java.lang.String classifier) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addCompileSourceRoot
protected void addCompileSourceRoot(java.io.File path)
- Parameters:
path- file to add to the project compile directories
-
getProject
public org.apache.maven.project.MavenProject getProject()
- Returns:
- the project
-
getLocalRepository
public org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
-
getRemoteRepositories
public java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepositories()
-
setupGenerateDirectory
protected java.io.File setupGenerateDirectory()
-
getGenerateDirectory
public java.io.File getGenerateDirectory()
-
getProjectArtifacts
public java.util.Set<org.apache.maven.artifact.Artifact> getProjectArtifacts()
-
getProjectRuntimeArtifacts
public java.util.Set<org.apache.maven.artifact.Artifact> getProjectRuntimeArtifacts()
-
-