Package fr.paris.lutece.maven
Class LiquiBaseSqlMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
fr.paris.lutece.maven.AbstractLuteceMojo
fr.paris.lutece.maven.AbstractLuteceWebappMojo
fr.paris.lutece.maven.LiquiBaseSqlMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="liquibase-sql",
requiresDependencyResolution=COMPILE_PLUS_RUNTIME)
@Execute(goal="liquibase-sql",
phase=PROCESS_RESOURCES)
public class LiquiBaseSqlMojo
extends AbstractLuteceWebappMojo
Tags SQL resources with liquibase tags.
The default behaviour is to overwrite SQL files.
-
Field Summary
FieldsFields inherited from class fr.paris.lutece.maven.AbstractLuteceWebappMojo
artifactFactory, artifactHandlerManager, artifacts, localConfDirectory, localRepository, metadataSource, remoteProjectRepositories, remoteRepositories, repoSession, repoSystem, resolver, targetDatabaseVendor, testWebappDirectory, unArchiver, webappDirectoryFields inherited from class fr.paris.lutece.maven.AbstractLuteceMojo
ANT_PATH, ARCHIVE_TIMESTAMP_PATTERN, ARCHIVE_TIMESTAMP_TIME_ZONE, ARTIFACT_BUILD_CONFIG, ASSEMBLY_WEBAPP_EXCLUDES, ASSEMBLY_WEBAPP_INCLUDES, ASSEMBLY_WEBAPP_SITE_EXCLUDES, ASSEMBLY_WEBAPP_SITE_INCLUDES, BUILD_CONFIG_PATH, BUILD_PROPERTIES_FILE, classesDirectory, DATABASE_VENDOR_AUTO, DATABASE_VENDOR_NONE, DATABASE_VENDORS, defaultConfDirectory, EXCLUDE_PATTERN_ASSEMBLY, EXCLUDE_PATTERN_BUSINESS, EXCLUDE_PATTERN_CLASSES, EXCLUDE_PATTERN_JAVA, EXCLUDE_PATTERN_LIB, EXCLUDE_PATTERN_PACKAGE_HTML, EXCLUDE_PATTERN_RESOURCES, EXCLUDE_PATTERN_SERVICE, EXCLUDE_PATTERN_SITE, EXCLUDE_PATTERN_SVN, EXCLUDE_PATTERN_TARGET, EXCLUDE_PATTERN_TEST, EXCLUDE_PATTERN_UTIL, EXCLUDE_PATTERN_UTILS, EXCLUDE_PATTERN_WEB, EXCLUDE_PATTERN_WEBAPP, EXCLUDE_PATTERN_WEBINF_TEST, INCLUDE_PATTERN_ALL, INCLUDE_PATTERN_RESOURCES, INCLUDE_PATTERN_SITE_USER, INCLUDE_PATTERN_SQL, INCLUDE_PATTERN_SRC, INCLUDE_PATTERN_WEBAPP, JUNIT, LUTECE_CORE_PACKAGING, LUTECE_CORE_TYPE, LUTECE_DIRECTORY, LUTECE_PLUGIN_PACKAGING, LUTECE_PLUGIN_TYPE, LUTECE_SITE_PACKAGING, LUTECE_SITE_TYPE, META_INF_DIRECTORY, outputDirectory, PACKAGE_CLASSES_EXCLUDES, PACKAGE_CLASSES_INCLUDES, PACKAGE_WEBAPP_EXCLUDES, PACKAGE_WEBAPP_INCLUDES, PACKAGE_WEBAPP_RESOURCES_EXCLUDES, PACKAGE_WEBAPP_RESOURCES_INCLUDE, PACKAGE_WEBAPP_SITE_EXCLUDES, PACKAGE_WEBAPP_SITE_INCLUDES, pluginVersion, POM_PACKAGING, project, reactorProjects, SERVLET_API, session, siteDirectory, sqlDirectory, WEB_INF_BUILD_PROPERTIES_PATH, WEB_INF_CLASSES_SQL_PATH, WEB_INF_DB_PROPERTIES_PATH, WEB_INF_DOC_XML_PATH, WEB_INF_SQL_PATH, WEBAPP_CLASSIFIER, webappSourceDirectoryFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsSqlOrders(String content) Checks if the given text contains SQL orders like SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE.voidexecute()static booleanisFileManagedByLiquibase(File candidate, String strBasePath) Tells whether plugin-liquibase runs an SQL file, which must then be copied to WEB-INF/classes/sql: a scriptSqlPathInforecognizes, or a pre-execution script (RunAfterOrdering.isPrerunScript(String)) wherever it sits.static booleanisTaggedWithLiquibase(File candidate, List<String> listFileErrors, String strBasePath) static booleanisTaggedWithLiquibase(String content) Returns true if the content is already tagged with a liquibase tagMethods inherited from class fr.paris.lutece.maven.AbstractLuteceWebappMojo
addToExplodedWebapp, copyBuildConfig, copyDirectory, copyThirdPartyJars, explodeConfigurationFiles, explodeCore, explodePlugins, explodeSites, explodeSqlFiles, explodeWebapp, filterArtifacts, getDependentJars, getRootProjectBuildDirectory, getRootProjectBuildDirectoryTarget, logCopiedMethods inherited from class fr.paris.lutece.maven.AbstractLuteceMojo
countExplodedModules, getDeployedJars, getSharedDirectoryLock, logBanner, validatePackagingMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
MICROPROFILE_CONFIG_PROPERTIES_FILE
- See Also:
-
SQL_EXT
- See Also:
-
-
Constructor Details
-
LiquiBaseSqlMojo
public LiquiBaseSqlMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
isTaggedWithLiquibase
Returns true if the content is already tagged with a liquibase tag- Parameters:
content-- Returns:
- the current "tagged" status
-
isTaggedWithLiquibase
-
containsSqlOrders
Checks if the given text contains SQL orders like SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE. The check is case-insensitive and looks for whole words only.- Parameters:
content- The text to check- Returns:
- true if any SQL order is found; false otherwise
-
isFileManagedByLiquibase
Tells whether plugin-liquibase runs an SQL file, which must then be copied to WEB-INF/classes/sql: a scriptSqlPathInforecognizes, or a pre-execution script (RunAfterOrdering.isPrerunScript(String)) wherever it sits.- Parameters:
candidate- the SQL filestrBasePath- the absolute path of the WEB-INF/sql directory- Returns:
- true if plugin-liquibase runs the file
-