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 Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory  
      protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource  
      protected ClasspathBuilder classpathBuilder  
      static java.lang.String GWT_GROUP_ID
      GWT artifacts groupId
      protected boolean gwtSdkFirstInClasspath
      Deprecated.
      tweak your dependencies and/or split your project with a client-only module
      protected org.apache.maven.artifact.repository.ArtifactRepository localRepository  
      protected java.lang.String modulePathPrefix
      Prefix to prepend to module names inside webappDirectory or in URLs in DevMode.
      protected java.util.List<org.apache.maven.artifact.repository.ArtifactRepository> remoteRepositories  
      protected org.apache.maven.artifact.resolver.ArtifactResolver resolver  
      static java.lang.String VAADIN_GROUP_ID  
      protected java.io.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

      Constructors 
      Constructor Description
      AbstractGwtMojo()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected int addClasspathElements​(java.util.Collection<?> elements, java.net.URL[] urls, int startPosition)
      Add classpath elements to a classpath URL set
      protected void addCompileSourceRoot​(java.io.File path)  
      protected org.apache.maven.artifact.Artifact getArtifact​(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 scope
      java.io.File getGenerateDirectory()  
      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.ArtifactRepository getLocalRepository()  
      java.io.File getOutputDirectory()  
      org.apache.maven.project.MavenProject getProject()  
      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 boolean isGenerator()
      Whether to use processed resources and compiled classes (false), or raw resources (true ).
      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)  
      protected java.io.File setupGenerateDirectory()  
      • 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 java.lang.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
      • 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 inside webappDirectory or in URLs in DevMode.

        Could also be seen as a suffix to webappDirectory.

      • warSourceDirectory

        @Parameter(defaultValue="${basedir}/src/main/webapp")
        protected java.io.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 java.io.File getOutputDirectory()
      • addClasspathElements

        protected int addClasspathElements​(java.util.Collection<?> elements,
                                           java.net.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 java.util.Collection<java.io.File> getClasspath​(java.lang.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 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()