Class AbstractLuteceMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
fr.paris.lutece.maven.AbstractLuteceMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractLuteceWebappMojo, PackageMojo

public abstract class AbstractLuteceMojo extends org.apache.maven.plugin.AbstractMojo
Abstracts functionnality common to all Lutece mojos.
  • Field Details

    • LUTECE_PLUGIN_TYPE

      protected static final String LUTECE_PLUGIN_TYPE
      The name of the lutece plugin artifact type.
      See Also:
    • LUTECE_CORE_TYPE

      protected static final String LUTECE_CORE_TYPE
      The name of the lutece core artifact type.
      See Also:
    • LUTECE_SITE_TYPE

      protected static final String LUTECE_SITE_TYPE
      The name of the lutece site artifact type.
      See Also:
    • LUTECE_CORE_PACKAGING

      protected static final String LUTECE_CORE_PACKAGING
      The name of the lutece core packaging.
      See Also:
    • LUTECE_PLUGIN_PACKAGING

      protected static final String LUTECE_PLUGIN_PACKAGING
      The name of the lutece plugin packaging.
      See Also:
    • LUTECE_SITE_PACKAGING

      protected static final String LUTECE_SITE_PACKAGING
      The name of the lutece site packaging.
      See Also:
    • POM_PACKAGING

      protected static final String POM_PACKAGING
      The name of the pom packaging.
      See Also:
    • WEBAPP_CLASSIFIER

      protected static final String WEBAPP_CLASSIFIER
      The classifier used for the webapp artifact.
      See Also:
    • LUTECE_DIRECTORY

      protected static final String LUTECE_DIRECTORY
      The name of the lutece directory.
      See Also:
    • ARTIFACT_BUILD_CONFIG

      protected static final String ARTIFACT_BUILD_CONFIG
      See Also:
    • JUNIT

      protected static final String JUNIT
      Artifacts never shipped in WEB-INF/lib : transitive dependencies do not always carry a usable scope, so they are excluded by name as well.
      See Also:
    • SERVLET_API

      protected static final String SERVLET_API
      See Also:
    • INCLUDE_PATTERN_ALL

      protected static final String INCLUDE_PATTERN_ALL
      Constants used to create inclusion or exclusion rules, for the zip, jar or war building.
      See Also:
    • INCLUDE_PATTERN_SQL

      protected static final String INCLUDE_PATTERN_SQL
      See Also:
    • INCLUDE_PATTERN_SRC

      protected static final String INCLUDE_PATTERN_SRC
      See Also:
    • INCLUDE_PATTERN_WEBAPP

      protected static final String INCLUDE_PATTERN_WEBAPP
      See Also:
    • INCLUDE_PATTERN_RESOURCES

      protected static final String INCLUDE_PATTERN_RESOURCES
      See Also:
    • INCLUDE_PATTERN_SITE_USER

      protected static final String INCLUDE_PATTERN_SITE_USER
      See Also:
    • EXCLUDE_PATTERN_CLASSES

      protected static final String EXCLUDE_PATTERN_CLASSES
      See Also:
    • EXCLUDE_PATTERN_LIB

      protected static final String EXCLUDE_PATTERN_LIB
      See Also:
    • EXCLUDE_PATTERN_SVN

      protected static final String EXCLUDE_PATTERN_SVN
      See Also:
    • EXCLUDE_PATTERN_ASSEMBLY

      protected static final String EXCLUDE_PATTERN_ASSEMBLY
      See Also:
    • EXCLUDE_PATTERN_TARGET

      protected static final String EXCLUDE_PATTERN_TARGET
      See Also:
    • EXCLUDE_PATTERN_WEBAPP

      protected static final String EXCLUDE_PATTERN_WEBAPP
      See Also:
    • EXCLUDE_PATTERN_JAVA

      protected static final String EXCLUDE_PATTERN_JAVA
      See Also:
    • EXCLUDE_PATTERN_SITE

      protected static final String EXCLUDE_PATTERN_SITE
      See Also:
    • EXCLUDE_PATTERN_TEST

      protected static final String EXCLUDE_PATTERN_TEST
      See Also:
    • EXCLUDE_PATTERN_PACKAGE_HTML

      protected static final String EXCLUDE_PATTERN_PACKAGE_HTML
      See Also:
    • EXCLUDE_PATTERN_RESOURCES

      protected static final String EXCLUDE_PATTERN_RESOURCES
      See Also:
    • EXCLUDE_PATTERN_BUSINESS

      protected static final String EXCLUDE_PATTERN_BUSINESS
      See Also:
    • EXCLUDE_PATTERN_WEB

      protected static final String EXCLUDE_PATTERN_WEB
      See Also:
    • EXCLUDE_PATTERN_SERVICE

      protected static final String EXCLUDE_PATTERN_SERVICE
      See Also:
    • EXCLUDE_PATTERN_UTILS

      protected static final String EXCLUDE_PATTERN_UTILS
      See Also:
    • EXCLUDE_PATTERN_UTIL

      protected static final String EXCLUDE_PATTERN_UTIL
      See Also:
    • EXCLUDE_PATTERN_WEBINF_TEST

      protected static final String EXCLUDE_PATTERN_WEBINF_TEST
      See Also:
    • PACKAGE_CLASSES_INCLUDES

      protected static final String[] PACKAGE_CLASSES_INCLUDES
    • PACKAGE_CLASSES_EXCLUDES

      protected static final String[] PACKAGE_CLASSES_EXCLUDES
    • PACKAGE_WEBAPP_INCLUDES

      protected static final String[] PACKAGE_WEBAPP_INCLUDES
      The files to include in webapp archives.
    • PACKAGE_WEBAPP_SITE_INCLUDES

      protected static final String[] PACKAGE_WEBAPP_SITE_INCLUDES
    • PACKAGE_WEBAPP_EXCLUDES

      protected static final String[] PACKAGE_WEBAPP_EXCLUDES
      The files to exclude from webapp archives.
    • PACKAGE_WEBAPP_SITE_EXCLUDES

      protected static final String[] PACKAGE_WEBAPP_SITE_EXCLUDES
    • PACKAGE_WEBAPP_RESOURCES_INCLUDE

      protected static final String[] PACKAGE_WEBAPP_RESOURCES_INCLUDE
      The files to includes from webapp archives.
    • PACKAGE_WEBAPP_RESOURCES_EXCLUDES

      protected static final String[] PACKAGE_WEBAPP_RESOURCES_EXCLUDES
      The files to exclude from webapp archives.
    • ASSEMBLY_WEBAPP_INCLUDES

      protected static final String[] ASSEMBLY_WEBAPP_INCLUDES
      The files to include in zip archives.
    • ASSEMBLY_WEBAPP_SITE_INCLUDES

      protected static final String[] ASSEMBLY_WEBAPP_SITE_INCLUDES
    • ASSEMBLY_WEBAPP_EXCLUDES

      protected static final String[] ASSEMBLY_WEBAPP_EXCLUDES
      The files to exclude from zip archives.
    • ASSEMBLY_WEBAPP_SITE_EXCLUDES

      protected static final String[] ASSEMBLY_WEBAPP_SITE_EXCLUDES
    • WEB_INF_SQL_PATH

      protected static final String WEB_INF_SQL_PATH
      Constante use for output path directory.
      See Also:
    • BUILD_CONFIG_PATH

      protected static final String BUILD_CONFIG_PATH
      See Also:
    • ANT_PATH

      protected static final String ANT_PATH
      See Also:
    • WEB_INF_CLASSES_SQL_PATH

      protected static final String WEB_INF_CLASSES_SQL_PATH
      See Also:
    • META_INF_DIRECTORY

      protected static final String META_INF_DIRECTORY
      See Also:
    • WEB_INF_DB_PROPERTIES_PATH

      protected static final String WEB_INF_DB_PROPERTIES_PATH
      See Also:
    • WEB_INF_BUILD_PROPERTIES_PATH

      protected static final String WEB_INF_BUILD_PROPERTIES_PATH
      See Also:
    • BUILD_PROPERTIES_FILE

      protected static final String BUILD_PROPERTIES_FILE
      See Also:
    • ARCHIVE_TIMESTAMP_PATTERN

      protected static final String ARCHIVE_TIMESTAMP_PATTERN
      Timestamp appended to assembly file names. "HH" is the 24-hour clock : with "hh", an assembly built at 13:30 and one built at 01:30 produced the very same file name.
      See Also:
    • ARCHIVE_TIMESTAMP_TIME_ZONE

      protected static final String ARCHIVE_TIMESTAMP_TIME_ZONE
      Time zone the archive timestamps are formatted in. Pinning it keeps the file names readable for the French teams that operate these assemblies, and keeps them stable whatever the time zone of the machine that happens to run the build.
      See Also:
    • DATABASE_VENDOR_NONE

      protected static final String DATABASE_VENDOR_NONE
      See Also:
    • DATABASE_VENDOR_AUTO

      protected static final String DATABASE_VENDOR_AUTO
      See Also:
    • DATABASE_VENDORS

      protected static final Collection<String> DATABASE_VENDORS
    • WEB_INF_DOC_XML_PATH

      protected static final String WEB_INF_DOC_XML_PATH
      See Also:
    • project

      @Parameter(property="project", readonly=true, required=true) protected org.apache.maven.project.MavenProject project
      The maven project.
    • session

      @Parameter(defaultValue="${session}", readonly=true) protected org.apache.maven.execution.MavenSession session
      The maven session
    • classesDirectory

      @Parameter(property="project.build.outputDirectory", required=true) protected File classesDirectory
      The directory containing the Java classes.
    • defaultConfDirectory

      @Parameter(property="defaultConfDirectory", defaultValue="${basedir}/src/conf/default") protected File defaultConfDirectory
      The directory containing the default configuration files.
    • webappSourceDirectory

      @Parameter(property="webappSourceDirectory", defaultValue="${basedir}/webapp", required=true) protected File webappSourceDirectory
      The source directory for webapp components.
    • sqlDirectory

      @Parameter(property="sqlDirectory", defaultValue="${basedir}/src/sql") protected File sqlDirectory
      The directory containing the database sql script.
    • siteDirectory

      @Parameter(property="siteDirectory", defaultValue="${basedir}/src/site") protected File siteDirectory
      The directory containing the default user documentation.
    • outputDirectory

      @Parameter(property="project.build.directory", required=true) protected File outputDirectory
      The project's output directory
    • reactorProjects

      @Parameter(property="reactorProjects", readonly=true) protected List<org.apache.maven.project.MavenProject> reactorProjects
      The projects in the reactor for aggregation report.
    • pluginVersion

      @Parameter(defaultValue="${plugin.version}", readonly=true) protected String pluginVersion
      The version of this plugin, so that the banner does not claim a hardcoded one.
  • Constructor Details

    • AbstractLuteceMojo

      public AbstractLuteceMojo()
  • Method Details

    • validatePackaging

      protected void validatePackaging(String... allowedPackagings) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getDeployedJars

      protected Set<org.apache.maven.artifact.Artifact> getDeployedJars()
      The jars already deployed to WEB-INF/lib, so that a library asked by several modules of a reactor is shipped once, in its highest version. On a single project nothing ever collides and this is only a record of what was copied.
      Returns:
      the shared set, never null
    • countExplodedModules

      protected int countExplodedModules()
      Records that a module has finished exploding, and returns how many have.
      Returns:
      the number of modules done so far, this one included
    • getSharedDirectoryLock

      protected Object getSharedDirectoryLock(File sharedDirectory)
      Returns the lock guarding a directory several modules of the build write into. A reactor assembles one shared webapp, so with -T the modules explode into the very same tree at the same time and corrupt each other. The lock lives in the session data, like the multi-project artifact sets, so it is the same object for every module of one build and disappears with it.
      Parameters:
      sharedDirectory - the directory the modules share
      Returns:
      the lock to synchronize on
    • logBanner

      public void logBanner()