Class 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 goal generate-metadata.

    This goal is executed/bound by default for Maven modules of type content-package.

    • Field Detail

      • 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
    • Constructor Detail

      • VaultMojo

        public VaultMojo()
    • Method Detail

      • createFileSet

        @NotNull
        protected @NotNull org.codehaus.plexus.archiver.util.DefaultFileSet createFileSet​(@NotNull
                                                                                          @NotNull File directory,
                                                                                          @NotNull
                                                                                          @NotNull String prefix)
        Creates a FileSet for the archiver
        Parameters:
        directory - the directory
        prefix - 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 a FileSet for the archiver
        Parameters:
        directory - the directory
        prefix - the prefix
        additionalExcludes - 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 directory
        prefix - the optional prefix to prepend to the relative file name before comparing with coveredFileNames
        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.