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 AbstractSourceAndMetadataPackageMojoBuilds 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 StringescapeStringExpression preceded with this String won't be interpolated.static StringPACKAGE_EXTstatic StringPACKAGE_TYPEprotected org.apache.maven.execution.MavenSessionsession-
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 voidaddFileSetToArchive(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 voidaddFileToArchive(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.DefaultFileSetcreateFileSet(@NotNull File directory, @NotNull String prefix)Creates aFileSetfor the archiverprotected @NotNull org.codehaus.plexus.archiver.util.DefaultFileSetcreateFileSet(@NotNull File directory, @NotNull String prefix, List<String> additionalExcludes)Creates aFileSetfor the archivervoidexecute()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.MavenResourcesExecutionsetupMavenResourcesExecution()-
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_TYPE
public static final String PACKAGE_TYPE
- See Also:
- Constant Field Values
-
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 aFileSetfor 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 aFileSetfor 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.MavenFilteringExceptionAdds 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.MavenFilteringExceptionAdds 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.MojoFailureExceptionExecutes this mojo- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.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 withcoveredFileNamescoveredFileNames- 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.
-
-