org.nuiton.eugene.plugin
Class GeneratateModelFilesMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.nuiton.plugin.AbstractPlugin
          extended by org.nuiton.eugene.plugin.AbstractEugeneMojo
              extended by org.nuiton.eugene.plugin.GeneratateModelFilesMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, ModelFileWriterConfiguration, org.nuiton.plugin.Plugin

public class GeneratateModelFilesMojo
extends AbstractEugeneMojo
implements ModelFileWriterConfiguration

User: chemit Date: 24 nov. 2009 Time: 00:22:37

Is defined by the goal name:
generate-model-files
Requires the dependencies in this specified scope:
compile

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.nuiton.plugin.Plugin
org.nuiton.plugin.Plugin.Packaging
 
Field Summary
protected  java.util.Set<ModelFileWriter> availableWriters
          All available writers for the given getModelClass()
protected  boolean dryRun
          Ne génère rien, analyse juste la configuration.
protected  java.io.File extraClassPathDirectory
          An extra directory to be added to the classpath.
protected  java.lang.String extractedPackages
          Nom du paquetage à générer
protected  java.lang.String fullPackagePath
          Nom du paquetage pour les fichiers générés
protected  java.lang.String[] includes
          Inputs files to used to generate the required model files.
protected  java.io.File outputDirectory
          Where to generate files.
protected  java.util.List<ModelFileWriter> plan
          Writers to process
protected  java.util.Map<java.lang.String,java.lang.Object> properties
          Properties to pass to writer.
protected  java.lang.String resolver
          Nom du resolver a utiliser
protected  java.util.Map<java.lang.String,ModelFileWriter> writers
          All available writers
 
Fields inherited from class org.nuiton.eugene.plugin.AbstractEugeneMojo
_models, encoding, modelClass, modelType, overwrite, project, settings, testPhase, verbose
 
Fields inherited from class org.nuiton.plugin.AbstractPlugin
skipAfterInitMessage
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
GeneratateModelFilesMojo()
           
 
Method Summary
protected  void doAction()
           
protected  java.lang.ClassLoader fixClassLoader()
          Prepare le classLoader a utiliser dans le generateur.
 java.util.Set<ModelFileWriter> getAvailableWriters()
           
 java.io.File getBasedir()
           
 java.lang.Class<? extends Model> getModelClass()
           
 java.io.File getOutputDirectory()
           
 java.util.Map<java.lang.String,java.lang.Object> getProperties()
           
protected  boolean init()
           
 
Methods inherited from class org.nuiton.eugene.plugin.AbstractEugeneMojo
getEncoding, getProject, getSettings, isOffline, isOverwrite, isVerbose, setEncoding, setOverwrite, setProject, setSettings, setVerbose
 
Methods inherited from class org.nuiton.plugin.AbstractPlugin
acceptPackaging, addCompileSourceRoots, addDirectoryToUrlsList, addResourceDir, addTestCompileSourceRoots, addTestResourceDir, addUrlToUrlsList, checkPackaging, checkResource, checkRunOnceDone, copyFile, execute, getFileFromBasedir, getFilesToTreate, getFilesToTreateForRoots, getTemplate, initClassLoader, isExecutionRoot, isFileNewerThanPomFile, rejectPackaging, removeCompileSourceRoots, removeTestCompileSourceRoots, writeFile
 
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
 
Methods inherited from interface org.nuiton.eugene.ModelFileWriterConfiguration
getEncoding, isOffline, isOverwrite, isVerbose
 
Methods inherited from interface org.apache.maven.plugin.Mojo
getLog, setLog
 

Field Detail

includes

protected java.lang.String[] includes
Inputs files to used to generate the required model files.

An include has the following pattern :
  writer:
 
when you want to use a specific writer with his default io values.

Can also write :

  [writer:]directory:includes
 
where includes is the pattern to find files from the directory given and must be terminated by the extension of files.

Specifying the writer can be usefull when you want to use a writer for an unknown extension by any writer.

Example :

 <includes>
     <include>zargo:<include>
     <include>src/main/xmi2:**\/*.zargo<include>
     <include>zargo:src/main/xmi:**\/*.zargo2<include>
 </includes>
 

Since:
2.0.0
Is defined by:
expression:
${eugene.includes}
Is required.

outputDirectory

protected java.io.File outputDirectory
Where to generate files.

Since:
2.0.0
Is defined by:
expression:
${eugene.outputDirectory}
default-value:
target/generated-sources
Is required.

properties

protected java.util.Map<java.lang.String,java.lang.Object> properties
Properties to pass to writer.

Since:
2.0.0
Is defined by:

dryRun

protected boolean dryRun
Ne génère rien, analyse juste la configuration.

Since:
2.0.0
Is defined by:
expression:
${eugene.dryRun}
default-value:
false

fullPackagePath

protected java.lang.String fullPackagePath
Nom du paquetage pour les fichiers générés

Since:
2.0.0
Is defined by:
expression:
${generator.fullPackagePath}
default-value:
${project.groupId}.${project.artifactId}

extractedPackages

protected java.lang.String extractedPackages
Nom du paquetage à générer

Since:
2.0.0
Is defined by:
expression:
${generator.extractedPackages}
default-value:
${project.groupId}.${project.artifactId}

resolver

protected java.lang.String resolver
Nom du resolver a utiliser

Since:
2.0.0
Is defined by:
expression:
${generator.resolver}
default-value:
org.nuiton.util.ResourceResolver

extraClassPathDirectory

protected java.io.File extraClassPathDirectory
An extra directory to be added to the classpath.

Since:
2.0.0
Is defined by:
expression:
${eugene.extraClassPathDirectory}

writers

protected java.util.Map<java.lang.String,ModelFileWriter> writers
All available writers

Is a Plexus component defined by:
role:
org.nuiton.eugene.ModelFileWriter

availableWriters

protected java.util.Set<ModelFileWriter> availableWriters
All available writers for the given getModelClass()


plan

protected java.util.List<ModelFileWriter> plan
Writers to process

Constructor Detail

GeneratateModelFilesMojo

public GeneratateModelFilesMojo()
Method Detail

init

protected boolean init()
                throws java.lang.Exception
Overrides:
init in class AbstractEugeneMojo
Throws:
java.lang.Exception

doAction

protected void doAction()
                 throws java.lang.Exception
Specified by:
doAction in class org.nuiton.plugin.AbstractPlugin
Throws:
java.lang.Exception

getOutputDirectory

public java.io.File getOutputDirectory()
Specified by:
getOutputDirectory in interface ModelFileWriterConfiguration

getProperties

public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Specified by:
getProperties in interface ModelFileWriterConfiguration

getAvailableWriters

public java.util.Set<ModelFileWriter> getAvailableWriters()
Specified by:
getAvailableWriters in interface ModelFileWriterConfiguration

getModelClass

public java.lang.Class<? extends Model> getModelClass()
Specified by:
getModelClass in interface ModelFileWriterConfiguration

getBasedir

public java.io.File getBasedir()
Specified by:
getBasedir in interface ModelFileWriterConfiguration

fixClassLoader

protected java.lang.ClassLoader fixClassLoader()
                                        throws org.apache.maven.plugin.MojoExecutionException
Prepare le classLoader a utiliser dans le generateur.

Si un extraClassPathDirectory a été renseigné, il est rajouté.

Si des références à des sibling modules, ils seront rajoutés aussi.

Returns:
le class loader modifie
Throws:
org.apache.maven.plugin.MojoExecutionException - if any pb


Copyright © 2006-2009 CodeLutin. All Rights Reserved.