org.codehaus.mojo.jpox
Class AbstractJpoxSchemaMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.jpox.AbstractJpoxMojo
          extended by org.codehaus.mojo.jpox.AbstractJpoxSchemaMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JpoxSchemaCreateMojo, JpoxSchemaDatabaseInfoMojo, JpoxSchemaDeleteMojo, JpoxSchemaInfoMojo, JpoxSchemaValidateMojo

public abstract class AbstractJpoxSchemaMojo
extends AbstractJpoxMojo

Extensions of this class implement the prepareModeSpecificCommandLineArguments(Commandline) method and provide mode-specific arguments to the SchemaTool invocation.

Following properties are at least required for the SchemaTool to execute:

SchemaTool properties can be specified in the POM configuration, or from command line. In case of conflicts, property values specified from command line take precedence.

An example JPOX-maven-plugin configuration can look like below:

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>jpox-maven-plugin</artifactId>
      <version>${jpox.plugin.version}</version>            
      <configuration>         
        <outputFile>${project.build.directory}/schema.sql</outputFile>
        <toolProperties>
          <property>
            <name>javax.jdo.option.ConnectionDriverName</name>
            <value>org.hsqldb.jdbcDriver</value>
          </property>
          <property>
            <name>javax.jdo.option.ConnectionURL</name>
            <value>jdbc:hsqldb:mem:continuum</value>
          </property>
          <property>
            <name>javax.jdo.option.ConnectionUserName</name>
            <value>sa</value>
          </property>                
          <property>
            <name>javax.jdo.option.ConnectionPassword</name>
            <value></value>
          </property>                
          <property>
            <name>log4j.configuration</name>
            <value>file:${basedir}/src/main/resources/log4j.properties</value>
          </property>
          <property>
            <name>org.jpox.autoCreateTables</name>
            <value>true</value>
          </property>
        </toolProperties>              
      </configuration>            
    </plugin>
 

Version:
$Id: AbstractJpoxSchemaMojo.java 6588 2008-03-28 12:22:57Z bentmann $
Author:
Rahul Thakur
See Also:
JPOX SchemaTool for other optional properties that can be specified.

Field Summary
 
Fields inherited from class org.codehaus.mojo.jpox.AbstractJpoxMojo
classes, pluginArtifacts
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJpoxSchemaMojo()
           
 
Method Summary
protected  void executeJpoxTool(java.util.List pluginArtifacts, java.net.URL log4jProperties, java.util.List files)
          Template method expected to be implemented by extensions.
protected  java.lang.String getToolName()
          Returns the Jpox tool name being invoked by this plugin's execution.
protected abstract  void prepareModeSpecificCommandLineArguments(org.codehaus.plexus.util.cli.Commandline cl)
          Template method that sets up arguments for the SchemaTool depending upon the mode invoked.
 
Methods inherited from class org.codehaus.mojo.jpox.AbstractJpoxMojo
execute, findMappingFiles, getUniqueClasspathElements
 
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
 

Constructor Detail

AbstractJpoxSchemaMojo

public AbstractJpoxSchemaMojo()
Method Detail

executeJpoxTool

protected void executeJpoxTool(java.util.List pluginArtifacts,
                               java.net.URL log4jProperties,
                               java.util.List files)
                        throws org.codehaus.plexus.util.cli.CommandLineException,
                               org.apache.maven.plugin.MojoExecutionException
Template method expected to be implemented by extensions. This acts as hook to invoke custom Jpox tool.

Specified by:
executeJpoxTool in class AbstractJpoxMojo
Throws:
org.codehaus.plexus.util.cli.CommandLineException
org.apache.maven.plugin.MojoExecutionException
See Also:
AbstractJpoxMojo.executeJpoxTool(java.util.List, java.net.URL, java.util.List)

prepareModeSpecificCommandLineArguments

protected abstract void prepareModeSpecificCommandLineArguments(org.codehaus.plexus.util.cli.Commandline cl)
Template method that sets up arguments for the SchemaTool depending upon the mode invoked.

This is expected to be implemented by extensions.

Parameters:
cl - Commandline instance to set up arguments for.

getToolName

protected java.lang.String getToolName()
Returns the Jpox tool name being invoked by this plugin's execution.

Specified by:
getToolName in class AbstractJpoxMojo
Returns:
Jpox tool/utility name being invoked.
See Also:
AbstractJpoxMojo.getToolName()


Copyright © 2010. All Rights Reserved.