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 ClasspathBuilderclasspathBuilderprotected static StringGWT_DEVstatic StringGWT_GROUP_IDGWT artifacts groupIdprotected static StringGWT_USERprotected booleangwtSdkFirstInClasspathDeprecated.tweak your dependencies and/or split your project with a client-only moduleprotected org.apache.maven.artifact.repository.ArtifactRepositorylocalRepositoryprotected StringmodulePathPrefixPrefix to prepend to module names insidewebappDirectoryor in URLs in DevMode.protected List<org.apache.maven.artifact.repository.ArtifactRepository>remoteRepositoriesprotected org.apache.maven.artifact.resolver.ArtifactResolverresolverprotected org.apache.maven.execution.MavenSessionsessionprotected 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(Collection<?> elements, URL[] urls, int startPosition)Add classpath elements to a classpath URL setprotected voidaddCompileSourceRoot(File path)Collection<File>getClasspath(String scope)Build the GWT classpath for the specified scopeFilegetGenerateDirectory()protected Collection<File>getGwtDevJar()protected Collection<File>getGwtUserJar()protected Collection<File>getJarFiles(String artifactId, boolean detectProjectDependencies)org.apache.maven.artifact.repository.ArtifactRepositorygetLocalRepository()FilegetOutputDirectory()org.apache.maven.project.MavenProjectgetProject()Set<org.apache.maven.artifact.Artifact>getProjectArtifacts()Set<org.apache.maven.artifact.Artifact>getProjectRuntimeArtifacts()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(String groupId, String artifactId, String version, String type, String classifier)protected FilesetupGenerateDirectory()-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
GWT_USER
protected static final String GWT_USER
- See Also:
- Constant Field Values
-
GWT_DEV
protected static final String GWT_DEV
- See Also:
- Constant Field Values
-
GWT_GROUP_ID
public static final String GWT_GROUP_ID
GWT artifacts groupId- 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.pluginArtifactRepositories}", required=true, readonly=true) protected List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories
-
artifactMetadataSource
@Component protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
-
session
@Parameter(defaultValue="${session}", required=true, readonly=true) protected org.apache.maven.execution.MavenSession session
-
modulePathPrefix
@Parameter(property="gwt.modulePathPrefix") protected 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 File warSourceDirectoryLocation of the web application static resources (same as maven-war-plugin parameter)
-
gwtSdkFirstInClasspath
@Deprecated @Parameter(defaultValue="false", property="gwt.gwtSdkFirstInClasspath") protected boolean gwtSdkFirstInClasspath
Deprecated.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 File getOutputDirectory()
-
addClasspathElements
protected int addClasspathElements(Collection<?> elements, URL[] urls, int startPosition) throws org.apache.maven.plugin.MojoExecutionException
Add 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 Collection<File> getClasspath(String scope) throws org.apache.maven.plugin.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:
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 Collection<File> getGwtDevJar() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getGwtUserJar
protected Collection<File> getGwtUserJar() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getJarFiles
protected Collection<File> getJarFiles(String artifactId, boolean detectProjectDependencies) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
resolve
protected org.apache.maven.artifact.Artifact resolve(String groupId, String artifactId, String version, String type, String classifier) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
addCompileSourceRoot
protected void addCompileSourceRoot(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 List<org.apache.maven.artifact.repository.ArtifactRepository> getRemoteRepositories()
-
setupGenerateDirectory
protected File setupGenerateDirectory()
-
getGenerateDirectory
public File getGenerateDirectory()
-
getProjectArtifacts
public Set<org.apache.maven.artifact.Artifact> getProjectArtifacts()
-
getProjectRuntimeArtifacts
public Set<org.apache.maven.artifact.Artifact> getProjectRuntimeArtifacts()
-
-