Class RawXJCMojo<O,​XSA extends Annotation,​XNA extends Annotation>

  • Type Parameters:
    O - type
    XSA - XML Schema Annotation type
    XNA - XML Namespace Annotation type
    All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, IDependencyResourceResolver
    Direct Known Subclasses:
    RawXJC2Mojo, RawXJC3Mojo

    public abstract class RawXJCMojo<O,​XSA extends Annotation,​XNA extends Annotation>
    extends AbstractXJCMojo<O>
    Abstract Maven JAXB Mojo.
    Author:
    Aleksei Valikov (valikov@gmx.net), Adam Retter (adam@evolvedbinary.com)
    • Field Detail

      • ADD_IF_EXISTS_TO_EPISODE_SCHEMA_BINDINGS_TRANSFORMATION_RESOURCE_NAME

        public static final String ADD_IF_EXISTS_TO_EPISODE_SCHEMA_BINDINGS_TRANSFORMATION_RESOURCE_NAME
    • Constructor Detail

      • RawXJCMojo

        public RawXJCMojo()
    • Method Detail

      • getXjcPluginArtifacts

        public Collection<org.apache.maven.artifact.Artifact> getXjcPluginArtifacts()
      • getXjcPluginURLs

        public List<URL> getXjcPluginURLs()
      • getEpisodeArtifacts

        public Collection<org.apache.maven.artifact.Artifact> getEpisodeArtifacts()
      • getSchemaFiles

        public List<File> getSchemaFiles()
      • getSchemaURIs

        protected List<URI> getSchemaURIs()
      • getResolvedSchemaURIs

        protected List<URI> getResolvedSchemaURIs()
      • getBindingFiles

        public List<File> getBindingFiles()
      • getBindingURIs

        protected List<URI> getBindingURIs()
      • getResolvedBindingURIs

        protected List<URI> getResolvedBindingURIs()
      • createBindingURIs

        protected List<URI> createBindingURIs()
                                       throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getDependsURIs

        public List<URI> getDependsURIs()
      • getProducesURIs

        public List<URI> getProducesURIs()
      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Execute the maven2 mojo to invoke the xjc2 compiler based on any configuration settings.
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • injectDependencyDefaults

        protected void injectDependencyDefaults()
        ************************************************************************* *
      • injectDependencyDefaults

        protected void injectDependencyDefaults​(org.apache.maven.model.Dependency[] dependencies)
      • resolveArtifacts

        protected void resolveArtifacts()
                                 throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • resolveXJCPluginArtifacts

        protected void resolveXJCPluginArtifacts()
                                          throws org.apache.maven.artifact.resolver.ArtifactResolutionException,
                                                 org.apache.maven.artifact.resolver.ArtifactNotFoundException,
                                                 org.apache.maven.project.artifact.InvalidDependencyVersionException
        Throws:
        org.apache.maven.artifact.resolver.ArtifactResolutionException
        org.apache.maven.artifact.resolver.ArtifactNotFoundException
        org.apache.maven.project.artifact.InvalidDependencyVersionException
      • resolveEpisodeArtifacts

        protected void resolveEpisodeArtifacts()
                                        throws org.apache.maven.artifact.resolver.ArtifactResolutionException,
                                               org.apache.maven.artifact.resolver.ArtifactNotFoundException,
                                               org.apache.maven.project.artifact.InvalidDependencyVersionException
        Throws:
        org.apache.maven.artifact.resolver.ArtifactResolutionException
        org.apache.maven.artifact.resolver.ArtifactNotFoundException
        org.apache.maven.project.artifact.InvalidDependencyVersionException
      • doExecute

        protected void doExecute()
                          throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getJaxbNamespaceUri

        protected abstract String getJaxbNamespaceUri()
      • getBindPackageInfoClassName

        protected abstract String getBindPackageInfoClassName()
      • getXmlSchemaAnnotationClass

        protected abstract Class<XSA> getXmlSchemaAnnotationClass()
      • getXmlSchemaAnnotationNamespace

        protected abstract String getXmlSchemaAnnotationNamespace​(XSA xmlSchemaAnnotation)
      • getXmlNamespaceAnnotationClass

        protected abstract Class<XNA> getXmlNamespaceAnnotationClass()
      • getXmlNamespaceAnnotationValue

        protected abstract String getXmlNamespaceAnnotationValue​(XNA xmlValueAnnotation)
      • getEpisodePackageInfoClassName

        protected abstract String getEpisodePackageInfoClassName()
      • doExecute

        public abstract void doExecute​(O options)
                                throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • setupLogging

        protected void setupLogging()
        Initializes logging. If Maven is run in debug mode (that is, debug level is enabled in the log), turn on the verbose mode in Mojo. Further on, if vebose mode is on, set the com.sun.tools.xjc.Options.findServices system property on to enable debuggin of XJC plugins.
      • setupMavenPaths

        protected void setupMavenPaths()
        Augments Maven paths with generated resources.
      • setupDirectories

        protected void setupDirectories()
      • setupSchemaFiles

        protected void setupSchemaFiles()
                                 throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • setupBindingFiles

        protected void setupBindingFiles()
                                  throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • setupDependsURIs

        protected void setupDependsURIs()
                                 throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • createProducesURIs

        protected List<URI> createProducesURIs()
                                        throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • logConfiguration

        protected void logConfiguration()
        Log the configuration settings. Shown when exception thrown or when verbose is true.
        Overrides:
        logConfiguration in class AbstractXJCMojo<O>
      • getCatalogURIs

        protected final List<URI> getCatalogURIs()
      • getResolvedCatalogURIs

        protected final List<URI> getResolvedCatalogURIs()
      • getCatalogResolverInstance

        protected final CatalogResolver getCatalogResolverInstance()
      • getEntityResolver

        protected final EntityResolver getEntityResolver()
      • createCatalogResolver

        protected final CatalogResolver createCatalogResolver()
                                                       throws org.apache.maven.plugin.MojoExecutionException
        Creates an instance of catalog resolver.
        Returns:
        Instance of the catalog resolver.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - If catalog resolver cannot be instantiated.
      • isUpToDate

        protected boolean isUpToDate()
        Returns:
        true to indicate results are up-to-date, that is, when the latest from input files is earlier than the younger from the output files (meaning no re-execution required).
      • getCustomHttpproxy

        protected String getCustomHttpproxy()
      • getActiveProxyAsHttpproxy

        protected String getActiveProxyAsHttpproxy()
      • getArguments

        protected List<String> getArguments()
        Returns array of command line arguments for XJC. These arguments are based on the configured arguments (see AbstractXJCMojo.getArgs()) but also include episode arguments.
        Returns:
        String array of XJC command line options.
      • getHttpproxy

        protected String getHttpproxy()