Class UberWarMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

    public class UberWarMojo
    extends AbstractUberWarMojo
    implements org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
    Builds an uber war.
    • Constructor Detail

      • UberWarMojo

        public UberWarMojo()
    • Method Detail

      • getConfigDirectory

        protected File getConfigDirectory()
        Returns:
        Parent file of the descriptor.
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Executes the UberWarMojo on the current project.
        Specified by:
        execute in interface org.apache.maven.plugin.Mojo
        Specified by:
        execute in class AbstractUberWarMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if an error occured while building the webapp
      • addAllTransitiveJars

        protected void addAllTransitiveJars​(WarArchiveMerger wam)
                                     throws org.apache.maven.plugin.MojoExecutionException
        Add all JAR files into the WAR file, calculated transitively and resolved in the normal 'maven' way (I.E if 2 war files contain different versions, resolve to using only *1* version).
        Parameters:
        wam - WAR archive manager.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If anything goes wrong.
      • addAllDependentJars

        protected void addAllDependentJars​(WarArchiveMerger wam)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Add all the JAR files specified into the merge - these will appear in the WEB-INF/lib directory.
        Parameters:
        wam - WAR archive manager.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If anything goes wrong.
      • addWar

        protected void addWar​(WarArchiveMerger wam,
                              String artifactIdent)
                       throws org.apache.maven.plugin.MojoExecutionException,
                              IOException
        Add a WAR to the uberwar.
        Parameters:
        wam - WAR archive merger.
        artifactIdent - Artifact identifier.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If mojos fail.
        IOException - If reading or writing fails.
      • addAllWars

        protected void addAllWars​(WarArchiveMerger wam)
                           throws org.apache.maven.plugin.MojoExecutionException,
                                  IOException
        Add all WARs from a merger.
        Parameters:
        wam - WAR archive merger.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If mojos fail.
        IOException - If reading or writing fails.
      • contextualize

        public void contextualize​(org.codehaus.plexus.context.Context context)
                           throws org.codehaus.plexus.context.ContextException
        Contextualize a context on the current container.
        Specified by:
        contextualize in interface org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
        Parameters:
        context - Context to contextualize.
        Throws:
        org.codehaus.plexus.context.ContextException - If anything goes wrong.