org.ow2.petals.plugin.jbiplugin
Class JBIAbstractMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.ow2.petals.plugin.jbiplugin.JBIAbstractMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JBIAbstractConfigurableMojo, JBIAbstractJMXMojo

public abstract class JBIAbstractMojo
extends org.apache.maven.plugin.AbstractMojo

This class is used to give the main configuration parameters of all JBI goals

Author:
cdeneux - Capgemini Sud

Field Summary
protected  org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
           
protected  org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
           
protected  java.io.File jbiDirectory
          JBI conf directory
protected  java.lang.String jbiName
          JBI archive name (will be suffixed by .zip).
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
          Local maven repository.
protected  org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder
           
protected  java.io.File outputDirectory
          Output directory
protected  java.lang.String packaging
           
protected static java.lang.String PACKAGING_COMPONENT
           
protected static java.lang.String PACKAGING_SA
           
protected static java.lang.String PACKAGING_SL
           
protected static java.lang.String PACKAGING_SU
           
protected  org.apache.maven.project.MavenProject project
          The Maven Project.
protected  org.apache.maven.artifact.Artifact projectArtifact
          Project artifact.
protected  org.apache.maven.settings.MavenSettingsBuilder settingsBuilder
           
protected  boolean verbose
          Verbose
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
JBIAbstractMojo()
           
 
Method Summary
protected  void attachedJBIArchive(org.apache.maven.artifact.Artifact artifact)
           
protected  org.apache.maven.project.MavenProject buildProjectFromArtifact(org.apache.maven.artifact.Artifact artifact)
          Create a maven project from the given artifact
protected  org.apache.maven.artifact.Artifact createDependencyArtifact(org.apache.maven.model.Dependency dependency)
          Create an Artifact from the given Dependency
protected  void debug(java.lang.String msg)
          Log the message as DEBUG one
protected  void error(java.lang.String msg)
          Log the message as ERROR one
protected  void error(java.lang.String msg, java.lang.Throwable exception)
          Log the message and the exception as ERROR one
 void execute()
           
protected abstract  void executeMojo()
          Execute the MOJO
protected  java.util.List<org.apache.maven.artifact.Artifact> getSharedLibraries(org.apache.maven.project.MavenProject lProject)
          Retrieve artifact associated to the shared libraries needed by Maven project associated to a JBI compoenent.
protected  void info(java.lang.String msg)
          Log the message as INFO one
protected  boolean packagingIsOkForGoal()
          Check if the current goal can be applied to the current packaging
protected  org.ow2.petals.jbi.descriptor.original.generated.Jbi readJbiDescriptor(org.apache.maven.artifact.Artifact artifact)
          Read and parse the JBI descriptor of an artifact
protected  void warn(java.lang.String msg)
          Log the message as WARNING one
 
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
 

Field Detail

PACKAGING_COMPONENT

protected static final java.lang.String PACKAGING_COMPONENT
See Also:
Constant Field Values

PACKAGING_SU

protected static final java.lang.String PACKAGING_SU
See Also:
Constant Field Values

PACKAGING_SA

protected static final java.lang.String PACKAGING_SA
See Also:
Constant Field Values

PACKAGING_SL

protected static final java.lang.String PACKAGING_SL
See Also:
Constant Field Values

jbiName

protected java.lang.String jbiName
JBI archive name (will be suffixed by .zip).


verbose

protected boolean verbose
Verbose


localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
Local maven repository.


outputDirectory

protected java.io.File outputDirectory
Output directory


project

protected org.apache.maven.project.MavenProject project
The Maven Project.


projectArtifact

protected org.apache.maven.artifact.Artifact projectArtifact
Project artifact.


packaging

protected java.lang.String packaging

jbiDirectory

protected java.io.File jbiDirectory
JBI conf directory


artifactResolver

protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver

artifactFactory

protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory

mavenProjectBuilder

protected org.apache.maven.project.MavenProjectBuilder mavenProjectBuilder

settingsBuilder

protected org.apache.maven.settings.MavenSettingsBuilder settingsBuilder
Constructor Detail

JBIAbstractMojo

public JBIAbstractMojo()
Method Detail

readJbiDescriptor

protected final org.ow2.petals.jbi.descriptor.original.generated.Jbi readJbiDescriptor(org.apache.maven.artifact.Artifact artifact)
                                                                                throws org.apache.maven.plugin.MojoExecutionException
Read and parse the JBI descriptor of an artifact

Parameters:
artifact - JBI artifact containing the JBI descriptor. Not null.
Throws:
org.apache.maven.plugin.MojoExecutionException

attachedJBIArchive

protected void attachedJBIArchive(org.apache.maven.artifact.Artifact artifact)

debug

protected void debug(java.lang.String msg)
Log the message as DEBUG one

Parameters:
msg -

info

protected void info(java.lang.String msg)
Log the message as INFO one

Parameters:
msg -

warn

protected void warn(java.lang.String msg)
Log the message as WARNING one

Parameters:
msg -

error

protected void error(java.lang.String msg)
Log the message as ERROR one

Parameters:
msg -

error

protected void error(java.lang.String msg,
                     java.lang.Throwable exception)
Log the message and the exception as ERROR one

Parameters:
msg -
exception -

execute

public final void execute()
                   throws org.apache.maven.plugin.MojoExecutionException,
                          org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

packagingIsOkForGoal

protected boolean packagingIsOkForGoal()
Check if the current goal can be applied to the current packaging

Returns:

buildProjectFromArtifact

protected org.apache.maven.project.MavenProject buildProjectFromArtifact(org.apache.maven.artifact.Artifact artifact)
                                                                  throws org.apache.maven.project.ProjectBuildingException
Create a maven project from the given artifact

Parameters:
artifact -
Returns:
Throws:
org.apache.maven.project.ProjectBuildingException

createDependencyArtifact

protected org.apache.maven.artifact.Artifact createDependencyArtifact(org.apache.maven.model.Dependency dependency)
                                                               throws org.apache.maven.artifact.versioning.InvalidVersionSpecificationException
Create an Artifact from the given Dependency

Parameters:
dependency - MUST be non null
Returns:
the created artifact
Throws:
org.apache.maven.artifact.versioning.InvalidVersionSpecificationException - problem with the version of the dependency

getSharedLibraries

protected java.util.List<org.apache.maven.artifact.Artifact> getSharedLibraries(org.apache.maven.project.MavenProject lProject)
                                                                         throws org.apache.maven.plugin.MojoExecutionException
Retrieve artifact associated to the shared libraries needed by Maven project associated to a JBI compoenent.

Returns:
A shared libraries list used by the current JBI component Maven project
Throws:
org.apache.maven.plugin.MojoExecutionException

executeMojo

protected abstract void executeMojo()
                             throws org.apache.maven.plugin.MojoExecutionException,
                                    org.apache.maven.plugin.MojoFailureException
Execute the MOJO

Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.