org.jvnet.jaxb2.maven2
Class RawXJC2Mojo<O>

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.jvnet.jaxb2.maven2.AbstractXJC2Mojo<O>
          extended by org.jvnet.jaxb2.maven2.RawXJC2Mojo<O>
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo, DependencyResourceResolver

public abstract class RawXJC2Mojo<O>
extends AbstractXJC2Mojo<O>

Maven JAXB 2.x Mojo.

Author:
Aleksei Valikov (valikov@gmx.net)

Field Summary
 
Fields inherited from class org.jvnet.jaxb2.maven2.AbstractXJC2Mojo
catalogResolver, plugins
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
RawXJC2Mojo()
           
 
Method Summary
protected  List<URI> createBindingURIs()
           
protected  com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver createCatalogResolver()
          Creates an instance of catalog resolver.
protected  ClassLoader createClassLoader(ClassLoader parent)
           
protected  EntityResolver createEntityResolver(com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver catalogResolver)
           
 OptionsConfiguration createOptionsConfiguration()
           
protected  List<URI> createProducesURIs()
           
protected  void doExecute()
           
abstract  void doExecute(O options)
           
 void execute()
          Execute the maven2 mojo to invoke the xjc2 compiler based on any configuration settings.
protected  List<String> getArguments()
          Returns array of command line arguments for XJC.
protected  List<InputSource> getBindFiles()
           
 List<File> getBindingFiles()
           
protected  List<URI> getBindingURIs()
           
protected  com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver getCatalogResolverInstance()
           
protected  List<URI> getCatalogURIs()
           
 List<URI> getDependsURIs()
           
protected  EntityResolver getEntityResolver()
           
 Collection<org.apache.maven.artifact.Artifact> getEpisodeArtifacts()
           
 Collection<File> getEpisodeFiles()
           
protected  List<InputSource> getGrammars()
           
 List<URI> getProducesURIs()
           
protected  List<URI> getResolvedBindingURIs()
           
protected  List<URI> getResolvedCatalogURIs()
           
protected  List<URI> getResolvedSchemaURIs()
           
 List<File> getSchemaFiles()
           
protected  List<URI> getSchemaURIs()
           
protected  URILastModifiedResolver getURILastModifiedResolver()
           
 Collection<org.apache.maven.artifact.Artifact> getXjcPluginArtifacts()
           
 Collection<File> getXjcPluginFiles()
           
 List<URL> getXjcPluginURLs()
           
protected  void injectDependencyDefaults()
          ************************************************************************* *
protected  void injectDependencyDefaults(org.apache.maven.model.Dependency[] dependencies)
           
protected  boolean isUpToDate()
           
protected  void logConfiguration()
          Log the configuration settings.
protected  void resolveArtifacts()
           
protected  void resolveEpisodeArtifacts()
           
protected  void resolveXJCPluginArtifacts()
           
protected  void setupBindingFiles()
           
protected  void setupDependsURIs()
           
protected  void setupDirectories()
           
protected  void setupLogging()
          Initializes logging.
protected  void setupMavenPaths()
          Augments Maven paths with generated resources.
protected  void setupSchemaFiles()
           
 
Methods inherited from class org.jvnet.jaxb2.maven2.AbstractXJC2Mojo
cleanPackageDirectory, createCatalogURIs, createResourceEntryUris, getAccessExternalDTD, getAccessExternalSchema, getAddCompileSourceRoot, getAddTestCompileSourceRoot, getArgs, getArtifactFactory, getArtifactMetadataSource, getArtifactResolver, getBindingDirectory, getBindingExcludes, getBindingIncludes, getBindings, getBuildContext, getCatalog, getCatalogDirectory, getCatalogExcludes, getCatalogIncludes, getCatalogResolver, getCatalogs, getCleanPackageDirectories, getContentForWildcard, getDebug, getDisableDefaultExcludes, getDisableXmlSecurity, getEnableIntrospection, getEncoding, getEpisode, getEpisodeFile, getEpisodes, getExtension, getForceRegenerate, getGenerateDirectory, getGeneratePackage, getLocale, getLocalRepository, getMarkGenerated, getMavenProjectBuilder, getNoFileHeader, getOptionsFactory, getOtherDepends, getPackageLevelAnnotations, getPluginArtifacts, getPlugins, getProduces, getProject, getReadOnly, getRemoveOldOutput, getScanDependenciesForBindings, getSchemaDirectory, getSchemaExcludes, getSchemaIncludes, getSchemaLanguage, getSchemas, getSpecVersion, getStrict, getUseDependenciesAsEpisodes, getVerbose, getWriteCode, logApiConfiguration, resolveDependencyResource, setAccessExternalDTD, setAccessExternalSchema, setAddCompileSourceRoot, setAddTestCompileSourceRoot, setArgs, setArtifactFactory, setArtifactMetadataSource, setArtifactResolver, setBindingDirectory, setBindingExcludes, setBindingIncludes, setBindings, setBuildContext, setCatalog, setCatalogDirectory, setCatalogExcludes, setCatalogIncludes, setCatalogResolver, setCatalogs, setCleanPackageDirectories, setContentForWildcard, setDebug, setDisableDefaultExcludes, setDisableXmlSecurity, setEnableIntrospection, setEncoding, setEpisode, setEpisodeFile, setEpisodes, setExtension, setForceRegenerate, setGenerateDirectory, setGeneratePackage, setLocale, setLocalRepository, setMarkGenerated, setMavenProjectBuilder, setNoFileHeader, setOtherDepends, setPackageLevelAnnotations, setPluginArtifacts, setPlugins, setProduces, setProject, setReadOnly, setRemoveOldOutput, setScanDependenciesForBindings, setSchemaDirectory, setSchemaExcludes, setSchemaIncludes, setSchemaLanguage, setSchemas, setSpecVersion, setStrict, setUseDependenciesAsEpisodes, setVerbose, setWriteCode
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RawXJC2Mojo

public RawXJC2Mojo()
Method Detail

getXjcPluginArtifacts

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

getXjcPluginFiles

public Collection<File> getXjcPluginFiles()

getXjcPluginURLs

public List<URL> getXjcPluginURLs()

getEpisodeArtifacts

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

getEpisodeFiles

public Collection<File> getEpisodeFiles()

getSchemaFiles

public List<File> getSchemaFiles()

getSchemaURIs

protected List<URI> getSchemaURIs()

getResolvedSchemaURIs

protected List<URI> getResolvedSchemaURIs()

getGrammars

protected List<InputSource> getGrammars()

getBindingFiles

public List<File> getBindingFiles()

getBindingURIs

protected List<URI> getBindingURIs()

getResolvedBindingURIs

protected List<URI> getResolvedBindingURIs()

getBindFiles

protected List<InputSource> getBindFiles()

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

createClassLoader

protected ClassLoader createClassLoader(ClassLoader parent)

doExecute

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

getURILastModifiedResolver

protected URILastModifiedResolver getURILastModifiedResolver()

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()

createProducesURIs

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

logConfiguration

protected void logConfiguration()
                         throws org.apache.maven.plugin.MojoExecutionException
Log the configuration settings. Shown when exception thrown or when verbose is true.

Overrides:
logConfiguration in class AbstractXJC2Mojo<O>
Throws:
org.apache.maven.plugin.MojoExecutionException

getCatalogURIs

protected List<URI> getCatalogURIs()

getResolvedCatalogURIs

protected List<URI> getResolvedCatalogURIs()

getCatalogResolverInstance

protected com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver getCatalogResolverInstance()

getEntityResolver

protected EntityResolver getEntityResolver()

createEntityResolver

protected EntityResolver createEntityResolver(com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver catalogResolver)

createCatalogResolver

protected com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver createCatalogResolver()
                                                                                        throws org.apache.maven.plugin.MojoExecutionException
Creates an instance of catalog resolver.

Returns:
Throws:
org.apache.maven.plugin.MojoExecutionException

isUpToDate

protected boolean isUpToDate()
                      throws org.apache.maven.plugin.MojoExecutionException
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).
Throws:
org.apache.maven.plugin.MojoExecutionException

getArguments

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

Returns:
String array of XJC command line options.
Throws:
org.apache.maven.plugin.MojoExecutionException

createOptionsConfiguration

public OptionsConfiguration createOptionsConfiguration()
                                                throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2006-2014. All Rights Reserved.