org.ow2.petals.plugin.jbiplugin
Class JBIAbstractConfigurableMojo

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

public abstract class JBIAbstractConfigurableMojo
extends JBIAbstractMojo

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

Author:
cdeneux - Capgemini Sud

Field Summary
protected  boolean includeConfiguration
          Flag to activate JBI archive configuration when packaging it.
protected static java.lang.String JBIDESCRIPTOR_ZIPENTRY_NAME
           
protected  java.lang.String jbiExtraBootstrapClasspathMappingFile
          Extra bootstrap classpath elements list mapping configuration file.
protected  java.net.URL jbiExtraBootstrapClasspathMappingFileURL
          Extra bootstrap classpath elements list mapping configuration file.
protected  java.lang.String jbiExtraComponentClasspathMappingFile
          Extra component classpath elements list mapping configuration file.
protected  java.net.URL jbiExtraComponentClasspathMappingFileURL
          Extra component classpath elements list mapping configuration file.
protected  java.lang.String jbiIdentifiersMappingFile
          JBI identifiers mapping configuration file.
protected  java.net.URL jbiIdentifiersMappingFileURL
          JBI identifiers mapping configuration file.
protected  java.lang.String jbiSharedLibrariesMappingFile
          JBI shared library list mapping configuration file.
protected  java.net.URL jbiSharedLibrariesMappingFileURL
          JBI shared library list mapping configuration file.
protected  java.lang.String jbiVersionsMappingFile
          JBI versions mapping configuration file.
protected  java.net.URL jbiVersionsMappingFileURL
          JBI versions mapping configuration file.
protected  java.lang.String sharedLibraryNameMappingInComponent
          Mapping pattern of the all shared library identifiers used inside a JBI component.
 
Fields inherited from class org.ow2.petals.plugin.jbiplugin.JBIAbstractMojo
artifactFactory, artifactResolver, jbiDirectory, jbiName, localRepository, mavenProjectBuilder, outputDirectory, packaging, PACKAGING_COMPONENT, PACKAGING_SA, PACKAGING_SL, PACKAGING_SU, project, projectArtifact, settingsBuilder, verbose
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
JBIAbstractConfigurableMojo()
           
 
Method Summary
protected  org.ow2.petals.jbi.descriptor.original.generated.Component.SharedLibrary artifactToSharedLibrary(org.apache.maven.artifact.Artifact artifact)
          Convert a shared library as a Maven artifact to the associated element of the component JBI descriptor.
protected  java.util.List<org.apache.maven.artifact.Artifact> evaluateBootstrapClasspathElts(org.apache.maven.artifact.Artifact artifact)
           Compute the extra bootstrap classpath elements of a component according to: the artifact match a pattern according to: the configuration mode (includeConfiguration) the artifact matches a pattern in the JBI extra bootstrap classpath elements mapping configuration file ( jbiExtraBootstrapClasspathMappingFile, jbiExtraBootstrapClasspathMappingFileURL)
protected  java.util.List<org.apache.maven.artifact.Artifact> evaluateComponentClasspathElts(org.apache.maven.artifact.Artifact artifact)
           Compute the extra component classpath elements of a component according to: the artifact match a pattern according to: the configuration mode (includeConfiguration) the artifact matches a pattern in the extra component classpath elements mapping configuration file ( jbiExtraComponentClasspathMappingFile, jbiExtraComponentClasspathMappingFileURL)
protected  java.lang.String evaluateJBIIdentifier(java.lang.String expression, org.apache.maven.artifact.Artifact artifact)
           Compute the JBI identifier of the artifact according to: the artifact match a pattern according to: the configuration mode (includeConfiguration) the artifact matches a pattern in the JBI identifiers mapping configuration file (jbiIdentifiersMappingFile) a default expression (expression)
protected  java.lang.String evaluateJBIVersion(java.lang.String expression, org.apache.maven.artifact.Artifact artifact)
           Compute the JBI version of the artifact according to: the artifact match a pattern according to: the configuration mode (includeConfiguration) the artifact matches a pattern in the JBI versions mapping configuration file (jbiVersionsMappingFile) a default expression (expression)
protected  java.util.List<org.ow2.petals.jbi.descriptor.original.generated.Component.SharedLibrary> evaluateSharedLibraries(org.apache.maven.artifact.Artifact artifact)
           Compute the JBI shared libraries list of a component according to: the artifact match a pattern according to: the configuration mode (includeConfiguration) the artifact matches a pattern in the JBI shared libraries list mapping configuration file (jbiSharedLibrariesMappingFile) the default shared library list provided by the original POM file, if existing, on which the mapping defined by the parameter sharedLibraryNameMappingInComponent is applied.
protected abstract  org.apache.maven.project.MavenProject getMavenProject()
          Returns the MavenProject associated to the artifact to configure.
protected  void readConfigurationFiles()
          Read all configuration file needed by the goal "jbi-configure".
 
Methods inherited from class org.ow2.petals.plugin.jbiplugin.JBIAbstractMojo
attachedJBIArchive, buildProjectFromArtifact, createDependencyArtifact, debug, error, error, execute, executeMojo, getSharedLibraries, info, packagingIsOkForGoal, readJbiDescriptor, warn
 
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

JBIDESCRIPTOR_ZIPENTRY_NAME

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

includeConfiguration

protected boolean includeConfiguration
Flag to activate JBI archive configuration when packaging it. If JBI identifiers mapping configuration file is not found, no configuration is applied.


sharedLibraryNameMappingInComponent

protected java.lang.String sharedLibraryNameMappingInComponent
Mapping pattern of the all shared library identifiers used inside a JBI component.


jbiIdentifiersMappingFile

protected java.lang.String jbiIdentifiersMappingFile
JBI identifiers mapping configuration file.


jbiIdentifiersMappingFileURL

protected java.net.URL jbiIdentifiersMappingFileURL
JBI identifiers mapping configuration file. If it does not exist through the classpath, the file is look for according to this URL.

See Also:
#jbiIdentifiersMappingFile}.

jbiSharedLibrariesMappingFile

protected java.lang.String jbiSharedLibrariesMappingFile
JBI shared library list mapping configuration file.


jbiSharedLibrariesMappingFileURL

protected java.net.URL jbiSharedLibrariesMappingFileURL
JBI shared library list mapping configuration file. If it does not exist through the classpath, the file is look for according to this URL.

See Also:
#jbiSharedLibrariesMappingFile}.

jbiVersionsMappingFile

protected java.lang.String jbiVersionsMappingFile
JBI versions mapping configuration file.


jbiVersionsMappingFileURL

protected java.net.URL jbiVersionsMappingFileURL
JBI versions mapping configuration file. If it does not exist through the classpath, the file is look for according to this URL.

See Also:
#jbiIdentifiersMappingFile}.

jbiExtraComponentClasspathMappingFile

protected java.lang.String jbiExtraComponentClasspathMappingFile
Extra component classpath elements list mapping configuration file.


jbiExtraComponentClasspathMappingFileURL

protected java.net.URL jbiExtraComponentClasspathMappingFileURL
Extra component classpath elements list mapping configuration file. If it does not exist through the classpath, the file is looked for according to this URL.

See Also:
#jbiExtraComponentClasspathMappingFile}.

jbiExtraBootstrapClasspathMappingFile

protected java.lang.String jbiExtraBootstrapClasspathMappingFile
Extra bootstrap classpath elements list mapping configuration file.


jbiExtraBootstrapClasspathMappingFileURL

protected java.net.URL jbiExtraBootstrapClasspathMappingFileURL
Extra bootstrap classpath elements list mapping configuration file. If it does not exist through the classpath, the file is looked for according to this URL.

See Also:
#jbiExtraBootstrapClasspathMappingFile}.
Constructor Detail

JBIAbstractConfigurableMojo

public JBIAbstractConfigurableMojo()
Method Detail

evaluateJBIIdentifier

protected java.lang.String evaluateJBIIdentifier(java.lang.String expression,
                                                 org.apache.maven.artifact.Artifact artifact)
                                          throws org.apache.maven.plugin.MojoExecutionException

Compute the JBI identifier of the artifact according to:

Parameters:
expression - The default expression defining the JBI identifier of the artifact
artifact - Artifact for which a JBI identifier must be defined
Returns:
The computed JBI identifier
Throws:
org.apache.maven.plugin.MojoExecutionException

evaluateJBIVersion

protected java.lang.String evaluateJBIVersion(java.lang.String expression,
                                              org.apache.maven.artifact.Artifact artifact)
                                       throws org.apache.maven.plugin.MojoExecutionException

Compute the JBI version of the artifact according to:

Parameters:
expression - The default expression defining the JBI version of the artifact
artifact - Artifact for which a JBI version must be defined
Returns:
The computed JBI version
Throws:
org.apache.maven.plugin.MojoExecutionException

evaluateSharedLibraries

protected java.util.List<org.ow2.petals.jbi.descriptor.original.generated.Component.SharedLibrary> evaluateSharedLibraries(org.apache.maven.artifact.Artifact artifact)
                                                                                                                    throws org.apache.maven.plugin.MojoExecutionException

Compute the JBI shared libraries list of a component according to:

Parameters:
artifact - Artifact for which a JBI shared libraries list must be defined
Returns:
The computed JBI shared libraries list
Throws:
org.apache.maven.plugin.MojoExecutionException

evaluateBootstrapClasspathElts

protected final java.util.List<org.apache.maven.artifact.Artifact> evaluateBootstrapClasspathElts(org.apache.maven.artifact.Artifact artifact)
                                                                                           throws org.apache.maven.plugin.MojoExecutionException

Compute the extra bootstrap classpath elements of a component according to:

Parameters:
artifact - Artifact for which extra bootstrap classpath elements must be added
Returns:
The computed bootstrap classpath elements list (full list, not only extra elements). List element is an Artifact.
Throws:
org.apache.maven.plugin.MojoExecutionException - An error occurs during resolution of the extra bootstap class path elements.

evaluateComponentClasspathElts

protected final java.util.List<org.apache.maven.artifact.Artifact> evaluateComponentClasspathElts(org.apache.maven.artifact.Artifact artifact)
                                                                                           throws org.apache.maven.plugin.MojoExecutionException

Compute the extra component classpath elements of a component according to:

Parameters:
artifact - Artifact for which extra component classpath elements must be added
Returns:
The computed component classpath elements list (full list, not only extra elements). List element is an Artifact.
Throws:
org.apache.maven.plugin.MojoExecutionException - An error occurs during resolution of the extra bootstap class path elements.

getMavenProject

protected abstract org.apache.maven.project.MavenProject getMavenProject()
Returns the MavenProject associated to the artifact to configure. In case of the goal "jbi-package", it's the project itself. In case of the goal "jbi-configure", it's the project associated to the provided artifact.

Returns:

artifactToSharedLibrary

protected org.ow2.petals.jbi.descriptor.original.generated.Component.SharedLibrary artifactToSharedLibrary(org.apache.maven.artifact.Artifact artifact)
                                                                                                    throws org.apache.maven.plugin.MojoExecutionException
Convert a shared library as a Maven artifact to the associated element of the component JBI descriptor. The shared library identifier is computed according to the defined configuration and mapping rules.

Parameters:
artifact -
Returns:
Throws:
org.apache.maven.plugin.MojoExecutionException

readConfigurationFiles

protected void readConfigurationFiles()
                               throws org.apache.maven.plugin.MojoExecutionException
Read all configuration file needed by the goal "jbi-configure".

Throws:
org.apache.maven.plugin.MojoExecutionException


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