Class AbstractWro4jMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    AbstractSingleProcessorMojo, Wro4jMojo

    public abstract class AbstractWro4jMojo
    extends org.apache.maven.plugin.AbstractMojo
    Defines most common properties used by wro4j build-time solution infrastructure.
    Author:
    Alex Objelean
    • Field Summary

      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract void doExecute()
      Perform actual plugin processing.
      void execute()  
      protected void extendPluginClasspath()
      Update the classpath.
      protected ro.isdc.wro.manager.factory.WroManagerFactory getManagerFactory()
      This method will ensure that you have a right and initialized instance of StandaloneContextAware.
      protected java.util.List<java.lang.String> getTargetGroupsAsList()  
      protected ro.isdc.wro.util.concurrent.TaskExecutor<java.lang.Void> getTaskExecutor()  
      protected boolean isIncrementalBuild()  
      protected boolean isIncrementalCheckRequired()  
      protected boolean isParallelProcessing()  
      protected ro.isdc.wro.manager.factory.WroManagerFactory newWroManagerFactory()
      Allows explicitly to override the default implementation of the factory, assuming wroManagerFactory configuration is not set.
      protected void onAfterExecute()
      Invoked right after execution completion.
      protected void onBeforeExecute()
      Invoked before execution is performed.
      protected void validate()
      Checks if all required fields are configured.
      • 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
    • Constructor Detail

      • AbstractWro4jMojo

        public AbstractWro4jMojo()
    • Method Detail

      • execute

        public final void execute()
                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • doExecute

        protected abstract void doExecute()
                                   throws java.lang.Exception
        Perform actual plugin processing.
        Throws:
        java.lang.Exception
      • getManagerFactory

        protected final ro.isdc.wro.manager.factory.WroManagerFactory getManagerFactory()
        This method will ensure that you have a right and initialized instance of StandaloneContextAware.
        Returns:
        WroManagerFactory implementation.
      • newWroManagerFactory

        protected ro.isdc.wro.manager.factory.WroManagerFactory newWroManagerFactory()
                                                                              throws org.apache.maven.plugin.MojoExecutionException
        Allows explicitly to override the default implementation of the factory, assuming wroManagerFactory configuration is not set. When overriding this method, make sure that onAfterCreate(WroManagerFactory) is invoked on newly created factory for proper initialization.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getTargetGroupsAsList

        protected final java.util.List<java.lang.String> getTargetGroupsAsList()
                                                                        throws java.lang.Exception
        Returns:
        a list of groups which will be processed.
        Throws:
        java.lang.Exception
      • validate

        protected void validate()
                         throws org.apache.maven.plugin.MojoExecutionException
        Checks if all required fields are configured.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • extendPluginClasspath

        protected final void extendPluginClasspath()
                                            throws org.apache.maven.plugin.MojoExecutionException
        Update the classpath.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getTaskExecutor

        protected final ro.isdc.wro.util.concurrent.TaskExecutor<java.lang.Void> getTaskExecutor()
        Returns:
        The TaskExecutor responsible for running multiple tasks in parallel.
      • isIncrementalCheckRequired

        protected boolean isIncrementalCheckRequired()
        Returns:
        true if the only incremental changed group should be used as target groups for next processing.
      • onBeforeExecute

        protected void onBeforeExecute()
        Invoked before execution is performed.
      • onAfterExecute

        protected void onAfterExecute()
        Invoked right after execution completion. This method is invoked also if the execution failed with an exception.
      • isIncrementalBuild

        protected final boolean isIncrementalBuild()
        Returns:
        true if the build was triggered by an incremental change.
      • isParallelProcessing

        protected final boolean isParallelProcessing()