Class 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.AbstractMojo
    Abstract Support class for all GWT-related operations.

    Provide methods to build classpath for GWT SDK tools.

    Version:
    $Id$
    Author:
    Nicolas De Loof
    • Field Detail

      • resolver

        @Component
        protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
      • artifactFactory

        @Component
        protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
      • 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 inside webappDirectory or in URLs in DevMode.

        Could also be seen as a suffix to webappDirectory.

      • warSourceDirectory

        @Parameter(defaultValue="${basedir}/src/main/webapp")
        protected File warSourceDirectory
        Location 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 module
        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
    • Constructor Detail

      • AbstractGwtMojo

        public AbstractGwtMojo()
    • 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 set
        urls - the urls to add
        startPosition - 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()