|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.plugin.AbstractMojo
org.dbmaintain.maven.plugin.BaseMojo
org.dbmaintain.maven.plugin.CreateScriptArchiveMojo
public class CreateScriptArchiveMojo
Task that enables creating a jar file that packages all database update scripts. This jar can then be used as
input for the updateDatabase task to apply changes on a target database.
This way, database updates can be distributed as a deliverable, just like a war or ear file.
The created jar file will contain all configuration concerning the scripts in the META-INF folder.
This operation will hook into the package stage and will attach the generated archive to the build (so that it
is installed in the local repository). The archive will have the same artifact id and group id as configured in
the pom. An optional classifier can be configured also.
A typical usage would be to create a pom of packaging type pom and then add this pom to your scripts folder.
<project>
<groupId>mygroup</groupId>
<artifactId>myScripts</artifactId>
<version>version</version>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.dbmaintain</groupId>
<artifactId>dbmaintain-maven-plugin</artifactId>
<version>-current dbmaintain version-</version>
<configuration>
<databases>
<database>
<dialect>oracle</dialect>
<driverClassName>oracle.jdbc.driver.OracleDriver</driverClassName>
<userName>user</userName>
<password>pass</password>
<url>jdbc:oracle:thin:@//localhost:1521/XE</url>
<schemaNames>TEST</schemaNames>
</database>
</databases>
</configuration>
<executions>
<execution>
<goals>
<goal>createScriptArchive</goal>
</goals>
</execution>
</executions>
</plugins>
</plugin>
</build>
</project>
The installed artifact can then later be used as a scriptArchiveDependency in for example the updateDatabase task.
You can also specify an explicit archive name. In that case, the archive will just be generated and not attached
to the build.
Field Summary | |
---|---|
protected String |
archiveFileName
Explicitly defines the target name for the generated script archive. |
protected String |
patchQualifiers
The qualifier to use to determine whether a script is a patch script. |
protected String |
postProcessingScriptDirectoryName
Comma separated list of directories and files in which the post processing database scripts are located. |
protected String |
qualifier
An optional qualifier for the artifact. |
protected String |
qualifiers
Optional comma-separated list of script qualifiers. |
protected String |
scriptEncoding
Encoding to use when reading the script files. |
protected String |
scriptFileExtensions
Sets the scriptFileExtensions property, that defines the extensions of the files that are regarded to be database scripts. |
protected String |
scriptLocations
Defines where the scripts can be found that must be added to the jar file. |
Fields inherited from class org.dbmaintain.maven.plugin.BaseMojo |
---|
artifactFactory, configFile, localRepository, mavenProjectHelper, project, remoteRepositories, resolver |
Fields inherited from interface org.apache.maven.plugin.Mojo |
---|
ROLE |
Constructor Summary | |
---|---|
CreateScriptArchiveMojo()
|
Method Summary | |
---|---|
protected DbMaintainTask |
createDbMaintainTask()
|
protected void |
performAfterTaskActions()
Hook method to perform some operations (such as attaching an artifact) when the task has completed successfully. |
Methods inherited from class org.dbmaintain.maven.plugin.BaseMojo |
---|
execute, getMavenProperties |
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 |
---|
protected String scriptLocations
protected String archiveFileName
protected String qualifier
protected String scriptEncoding
protected String postProcessingScriptDirectoryName
protected String qualifiers
protected String patchQualifiers
protected String scriptFileExtensions
Constructor Detail |
---|
public CreateScriptArchiveMojo()
Method Detail |
---|
protected DbMaintainTask createDbMaintainTask()
createDbMaintainTask
in class BaseMojo
protected void performAfterTaskActions()
BaseMojo
performAfterTaskActions
in class BaseMojo
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |