org.exoplatform.maven.plugin.exobuild
Class ExobuildMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.exoplatform.maven.plugin.exobuild.AbstractDependencyMojo
          extended by org.exoplatform.maven.plugin.exobuild.AbstractDependencyFilterMojo
              extended by org.exoplatform.maven.plugin.exobuild.AbstractFromDependenciesMojo
                  extended by org.exoplatform.maven.plugin.exobuild.ExobuildMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class ExobuildMojo
extends AbstractFromDependenciesMojo


Field Summary
static String CLASSPATH_TOKEN
           
protected  String classpathScope
          Defines the scope of the classpath passed to the plugin.
protected  String exoBaseDir
           
protected  String exobuildJBossVersion
           
protected  String exobuildTomcatVersion
           
protected  File exoDependenciesDir
           
protected  File exoWorkingDir
           
protected  org.apache.maven.artifact.installer.ArtifactInstaller installer
           
protected  File outputDirectoryPackager
          Default location used for mojo unless overridden in ArtifactItem
protected  File outputDirectoryPackagerConf
          Default location used for mojo unless overridden in ArtifactItem
protected  org.apache.maven.artifact.repository.ArtifactRepositoryFactory repositoryFactory
           
 
Fields inherited from class org.exoplatform.maven.plugin.exobuild.AbstractFromDependenciesMojo
copyPom, failOnMissingClassifierArtifact, outputDirectory, stripVersion, useRepositoryLayout, useSubDirectoryPerArtifact, useSubDirectoryPerType
 
Fields inherited from class org.exoplatform.maven.plugin.exobuild.AbstractDependencyFilterMojo
classifier, excludeArtifactIds, excludeClassifiers, excludeGroupIds, excludeScope, excludeTransitive, excludeTypes, includeArtifactIds, includeClassifiers, includeGroupIds, includeScope, includeTypes, markersDirectory, overWriteIfNewer, overWriteReleases, overWriteSnapshots, type
 
Fields inherited from class org.exoplatform.maven.plugin.exobuild.AbstractDependencyMojo
archiverManager, artifactCollector, artifactMetadataSource, factory, local, outputAbsoluteArtifactFilename, project, reactorProjects, remoteRepos, resolver, silent
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
ExobuildMojo()
           
 
Method Summary
protected  void collectProjectArtifactsAndClasspath(List artifacts, List theClasspathFiles)
          Collects the project artifacts in the specified List and the project specific classpath (build output and build test output) Files in the specified List, depending on the plugin classpathScope value.
 void copyPoms(File destDir, Set artifacts, boolean removeVersion)
          Copy the pom files associated with the artifacts.
 void execute()
          Main entry into mojo.
protected  int executeCommandLine(org.codehaus.plexus.util.cli.Commandline commandLine, org.codehaus.plexus.util.cli.StreamConsumer stream1, org.codehaus.plexus.util.cli.StreamConsumer stream2)
           
 void executeExobuild(String deployTarget)
          priority in the execute method will be to use System properties arguments over the pom specification.
protected  org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
           
protected  org.apache.maven.artifact.Artifact getResolvedPomArtifact(org.apache.maven.artifact.Artifact artifact)
           
 List getSuccessCodes()
           
protected  String getSystemProperty(String key)
           
protected  boolean hasCommandlineArgs()
           
protected  String[] parseCommandlineArgs()
          Parses the argument string given by the user.
protected  void registerSourceRoots()
          Register compile and compile tests source roots if necessary
 void setSuccessCodes(List list)
           
 
Methods inherited from class org.exoplatform.maven.plugin.exobuild.AbstractFromDependenciesMojo
getOutputDirectory, isCopyPom, isFailOnMissingClassifierArtifact, isStripVersion, isUseRepositoryLayout, isUseSubDirectoryPerArtifact, isUseSubDirectoryPerType, setCopyPom, setFailOnMissingClassifierArtifact, setOutputDirectory, setStripVersion, setUseRepositoryLayout, setUseSubDirectoryPerArtifact, setUseSubDirectoryPerType
 
Methods inherited from class org.exoplatform.maven.plugin.exobuild.AbstractDependencyFilterMojo
filterMarkedDependencies, getClassifierTranslatedDependencies, getDependencySets, getMarkersDirectory, getResolvedDependencies, setMarkersDirectory
 
Methods inherited from class org.exoplatform.maven.plugin.exobuild.AbstractDependencyMojo
copyFile, getArchiverManager, getArtifactCollector, getArtifactMetadataSource, getFactory, getLocal, getLog, getProject, getRemoteRepos, getResolver, setArchiverManager, setArtifactCollector, setArtifactMetadataSource, setFactory, setLocal, setRemoteRepos, setResolver, unpack, unpack
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

exoWorkingDir

protected File exoWorkingDir
Since:
1.0

exoDependenciesDir

protected File exoDependenciesDir
Since:
1.0

exobuildTomcatVersion

protected String exobuildTomcatVersion
Since:
1.0

exobuildJBossVersion

protected String exobuildJBossVersion
Since:
1.0

exoBaseDir

protected String exoBaseDir
Since:
1.0

outputDirectoryPackager

protected File outputDirectoryPackager
Default location used for mojo unless overridden in ArtifactItem

Since:
1.0

outputDirectoryPackagerConf

protected File outputDirectoryPackagerConf
Default location used for mojo unless overridden in ArtifactItem

Since:
1.0

installer

protected org.apache.maven.artifact.installer.ArtifactInstaller installer

repositoryFactory

protected org.apache.maven.artifact.repository.ArtifactRepositoryFactory repositoryFactory

CLASSPATH_TOKEN

public static final String CLASSPATH_TOKEN
See Also:
Constant Field Values

classpathScope

protected String classpathScope
Defines the scope of the classpath passed to the plugin. Set to compile,test,runtime or system depending on your needs. Since 1.1.2, the default value is 'runtime' instead of 'compile'.

Constructor Detail

ExobuildMojo

public ExobuildMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Main entry into mojo. Gets the list of dependencies and iterates through calling copyArtifact.

Throws:
org.apache.maven.plugin.MojoExecutionException - with a message if an error occurs.
See Also:
#getDependencies, #copyArtifact(Artifact, boolean)

copyPoms

public void copyPoms(File destDir,
                     Set artifacts,
                     boolean removeVersion)
              throws org.apache.maven.plugin.MojoExecutionException
Copy the pom files associated with the artifacts.

Throws:
org.apache.maven.plugin.MojoExecutionException

getResolvedPomArtifact

protected org.apache.maven.artifact.Artifact getResolvedPomArtifact(org.apache.maven.artifact.Artifact artifact)

getMarkedArtifactFilter

protected org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter getMarkedArtifactFilter()
Specified by:
getMarkedArtifactFilter in class AbstractDependencyFilterMojo

executeExobuild

public void executeExobuild(String deployTarget)
                     throws org.apache.maven.plugin.MojoExecutionException
priority in the execute method will be to use System properties arguments over the pom specification.

Parameters:
deployTarget - TODO
Throws:
org.apache.maven.plugin.MojoExecutionException - if a failure happens

executeCommandLine

protected int executeCommandLine(org.codehaus.plexus.util.cli.Commandline commandLine,
                                 org.codehaus.plexus.util.cli.StreamConsumer stream1,
                                 org.codehaus.plexus.util.cli.StreamConsumer stream2)
                          throws org.codehaus.plexus.util.cli.CommandLineException
Throws:
org.codehaus.plexus.util.cli.CommandLineException

getSystemProperty

protected String getSystemProperty(String key)

setSuccessCodes

public void setSuccessCodes(List list)

getSuccessCodes

public List getSuccessCodes()

collectProjectArtifactsAndClasspath

protected void collectProjectArtifactsAndClasspath(List artifacts,
                                                   List theClasspathFiles)
Collects the project artifacts in the specified List and the project specific classpath (build output and build test output) Files in the specified List, depending on the plugin classpathScope value.

Parameters:
artifacts - the list where to collect the scope specific artifacts
theClasspathFiles - the list where to collect the scope specific output directories
Throws:
NullPointerException - if at least one of the parameter is null

parseCommandlineArgs

protected String[] parseCommandlineArgs()
                                 throws org.apache.maven.plugin.MojoExecutionException
Parses the argument string given by the user. Strings are recognized as everything between STRING_WRAPPER. PARAMETER_DELIMITER is ignored inside a string. STRING_WRAPPER and PARAMETER_DELIMITER can be escaped using ESCAPE_CHAR.

Returns:
Array of String representing the arguments
Throws:
org.apache.maven.plugin.MojoExecutionException - for wrong formatted arguments

hasCommandlineArgs

protected boolean hasCommandlineArgs()
Returns:
true of the mojo has command line arguments

registerSourceRoots

protected void registerSourceRoots()
Register compile and compile tests source roots if necessary



Copyright © 2009 eXo Platform SAS. All Rights Reserved.