Class GenerateCndMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="generate-cnd",
          defaultPhase=GENERATE_SOURCES,
          requiresDependencyResolution=COMPILE,
          threadSafe=true)
    public class GenerateCndMojo
    extends AbstractSourceAndMetadataPackageMojo
    Generates a CND file containing all used node types and namespaces. It uses the default namespaces and node types and in addition some provided ones as source node type and namespace registry. From those only the ones being really leveraged in the package end up in the generated CND. The generated CND will end up in the package metadata and all contained namespaces and node types are automatically registered during installation (in case they are not yet registered).
    Since:
    1.3.0
    • Constructor Detail

      • GenerateCndMojo

        public GenerateCndMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • generateCnd

        public int generateCnd​(org.apache.jackrabbit.vault.util.StandaloneManagerProvider managerProvider,
                               Path cndOutputFile,
                               Path jcrSourceDirectory)
                        throws IOException,
                               javax.jcr.RepositoryException,
                               org.apache.jackrabbit.commons.cnd.ParseException
        Throws:
        IOException
        javax.jcr.RepositoryException
        org.apache.jackrabbit.commons.cnd.ParseException