Class VaultMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.jackrabbit.filevault.maven.packaging.mojo.AbstractMetadataPackageMojo
-
- org.apache.jackrabbit.filevault.maven.packaging.mojo.AbstractSourceAndMetadataPackageMojo
-
- org.apache.jackrabbit.filevault.maven.packaging.mojo.VaultMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="package", defaultPhase=PACKAGE, requiresDependencyResolution=COMPILE, threadSafe=true) public class VaultMojo extends AbstractSourceAndMetadataPackageMojo
Builds a content package. Uses the metadata generated by and embedded artifacts (like subpackages or OSGi bundles) configured in a preceding execution of goalgenerate-metadata
.This goal is executed/bound by default for Maven modules of type
content-package
.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
escapeString
Expression preceded with this String won't be interpolated.static String
PACKAGE_EXT
protected org.apache.maven.execution.MavenSession
session
-
Fields inherited from class org.apache.jackrabbit.filevault.maven.packaging.mojo.AbstractSourceAndMetadataPackageMojo
addDefaultExcludes, excludes
-
Fields inherited from class org.apache.jackrabbit.filevault.maven.packaging.mojo.AbstractMetadataPackageMojo
classifier, outputTimestamp, project
-
-
Constructor Summary
Constructors Constructor Description VaultMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addFileSetToArchive(org.apache.maven.shared.filtering.MavenResourcesExecution mavenResourcesExecution, ContentPackageArchiver archiver, org.codehaus.plexus.archiver.util.DefaultFileSet fileSet)
Adds a fileSet to the archiver and optionally applies some filtering.protected void
addFileToArchive(org.apache.maven.shared.filtering.MavenResourcesExecution mavenResourcesExecution, ContentPackageArchiver archiver, File sourceFile, String destFileName)
Adds a file to the archiver and optionally applies some filtering.protected @NotNull org.codehaus.plexus.archiver.util.DefaultFileSet
createFileSet(@NotNull File directory, @NotNull String prefix)
Creates aFileSet
for the archiverprotected @NotNull org.codehaus.plexus.archiver.util.DefaultFileSet
createFileSet(@NotNull File directory, @NotNull String prefix, List<String> additionalExcludes)
Creates aFileSet
for the archivervoid
execute()
Executes this mojoprotected static Collection<File>
getUncoveredFiles(File sourceDirectory, Collection<String> excludes, String prefix, Collection<String> coveredFileNames)
Checks if some files (optionally prefixed) below the given source directory are not listed in coveredFilesprotected org.apache.maven.shared.filtering.MavenResourcesExecution
setupMavenResourcesExecution()
-
Methods inherited from class org.apache.jackrabbit.filevault.maven.packaging.mojo.AbstractSourceAndMetadataPackageMojo
getJcrSourceDirectory, getJcrSourceDirectory
-
Methods inherited from class org.apache.jackrabbit.filevault.maven.packaging.mojo.AbstractMetadataPackageMojo
getFirstExistingDirectory, getMetaInfVaultSourceDirectory, getMetaInfVaultSourceDirectory, getProjectRelativeFilePath, getRelativePath, resolveArtifact, setPrefix
-
-
-
-
Field Detail
-
PACKAGE_EXT
public static final String PACKAGE_EXT
- See Also:
- Constant Field Values
-
escapeString
@Parameter(property="vault.escapeString") protected String escapeString
Expression preceded with this String won't be interpolated.\${foo}
will be replaced with${foo}
.- Since:
- 1.1.0
-
session
@Parameter(defaultValue="${session}", readonly=true, required=false) protected org.apache.maven.execution.MavenSession session
-
-
Method Detail
-
createFileSet
@NotNull protected @NotNull org.codehaus.plexus.archiver.util.DefaultFileSet createFileSet(@NotNull @NotNull File directory, @NotNull @NotNull String prefix)
Creates aFileSet
for the archiver- Parameters:
directory
- the directoryprefix
- the prefix- Returns:
- the fileset
-
createFileSet
@NotNull protected @NotNull org.codehaus.plexus.archiver.util.DefaultFileSet createFileSet(@NotNull @NotNull File directory, @NotNull @NotNull String prefix, List<String> additionalExcludes)
Creates aFileSet
for the archiver- Parameters:
directory
- the directoryprefix
- the prefixadditionalExcludes
- excludes- Returns:
- the fileset
-
addFileToArchive
protected void addFileToArchive(org.apache.maven.shared.filtering.MavenResourcesExecution mavenResourcesExecution, ContentPackageArchiver archiver, File sourceFile, String destFileName) throws org.apache.maven.shared.filtering.MavenFilteringException
Adds a file to the archiver and optionally applies some filtering.- Parameters:
mavenResourcesExecution
-archiver
-sourceFile
-destFileName
-- Throws:
org.apache.maven.shared.filtering.MavenFilteringException
- in case filtering failed
-
addFileSetToArchive
protected void addFileSetToArchive(org.apache.maven.shared.filtering.MavenResourcesExecution mavenResourcesExecution, ContentPackageArchiver archiver, org.codehaus.plexus.archiver.util.DefaultFileSet fileSet) throws org.apache.maven.shared.filtering.MavenFilteringException
Adds a fileSet to the archiver and optionally applies some filtering.- Parameters:
mavenResourcesExecution
-archiver
-fileSet
-- Throws:
org.apache.maven.shared.filtering.MavenFilteringException
- in case filtering failed
-
setupMavenResourcesExecution
protected org.apache.maven.shared.filtering.MavenResourcesExecution setupMavenResourcesExecution()
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Executes this mojo- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
getUncoveredFiles
protected static Collection<File> getUncoveredFiles(File sourceDirectory, Collection<String> excludes, String prefix, Collection<String> coveredFileNames)
Checks if some files (optionally prefixed) below the given source directory are not listed in coveredFiles- Parameters:
sourceDirectory
- the source directoryprefix
- the optional prefix to prepend to the relative file name before comparing withcoveredFileNames
coveredFileNames
- the covered file names (should have relative file names), might have OS specific separators- Returns:
- the absolute file names in the source directory which are not already listed in
entryNames
.
-
-