Package org.jvnet.jaxb2.maven2
Class RawXJC2Mojo<O>
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.jvnet.jaxb2.maven2.AbstractXJC2Mojo<O>
-
- 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 Modifier and Type Field Description static StringADD_IF_EXISTS_TO_EPISODE_SCHEMA_BINDINGS_TRANSFORMATION_RESOURCE_NAME-
Fields inherited from class org.jvnet.jaxb2.maven2.AbstractXJC2Mojo
catalogResolver, plugins
-
-
Constructor Summary
Constructors Constructor Description RawXJC2Mojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected List<URI>createBindingURIs()protected com.sun.org.apache.xml.internal.resolver.tools.CatalogResolvercreateCatalogResolver()Creates an instance of catalog resolver.protected ClassLoadercreateClassLoader(ClassLoader parent)protected EntityResolvercreateEntityResolver(com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver catalogResolver)OptionsConfigurationcreateOptionsConfiguration()protected List<URI>createProducesURIs()protected voiddoExecute()abstract voiddoExecute(O options)voidexecute()Execute the maven2 mojo to invoke the xjc2 compiler based on any configuration settings.protected StringgetActiveProxyAsHttpproxy()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.CatalogResolvergetCatalogResolverInstance()protected List<URI>getCatalogURIs()protected StringgetCustomHttpproxy()List<URI>getDependsURIs()protected EntityResolvergetEntityResolver()Collection<org.apache.maven.artifact.Artifact>getEpisodeArtifacts()Collection<File>getEpisodeFiles()protected List<InputSource>getGrammars()protected StringgetHttpproxy()List<URI>getProducesURIs()protected List<URI>getResolvedBindingURIs()protected List<URI>getResolvedCatalogURIs()protected List<URI>getResolvedSchemaURIs()List<File>getSchemaFiles()protected List<URI>getSchemaURIs()protected URILastModifiedResolvergetURILastModifiedResolver()Collection<org.apache.maven.artifact.Artifact>getXjcPluginArtifacts()Collection<File>getXjcPluginFiles()List<URL>getXjcPluginURLs()protected voidinjectDependencyDefaults()************************************************************************* *protected voidinjectDependencyDefaults(org.apache.maven.model.Dependency[] dependencies)protected booleanisUpToDate()protected voidlogConfiguration()Log the configuration settings.protected voidresolveArtifacts()protected voidresolveEpisodeArtifacts()protected voidresolveXJCPluginArtifacts()protected voidsetupBindingFiles()protected voidsetupDependsURIs()protected voidsetupDirectories()protected voidsetupLogging()Initializes logging.protected voidsetupMavenPaths()Augments Maven paths with generated resources.protected voidsetupSchemaFiles()-
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, getOtherDependsExcludes, getOtherDependsIncludes, getPackageLevelAnnotations, getPluginArtifacts, getPlugins, getProduces, getProject, getProjectDependencies, getProxyHost, getProxyPassword, getProxyPort, getProxyUsername, getReadOnly, getRemoveOldOutput, getScanDependenciesForBindings, getSchemaDirectory, getSchemaExcludes, getSchemaIncludes, getSchemaLanguage, getSchemas, getSettings, getSpecVersion, getStrict, getUseDependenciesAsEpisodes, getVerbose, getWriteCode, isAddIfExistsToEpisodeSchemaBindings, isEnableExternalEntityProcessing, isUseActiveProxyAsHttpproxy, logApiConfiguration, resolveDependencyResource, setAccessExternalDTD, setAccessExternalSchema, setAddCompileSourceRoot, setAddIfExistsToEpisodeSchemaBindings, setAddTestCompileSourceRoot, setArgs, setArtifactFactory, setArtifactMetadataSource, setArtifactResolver, setBindingDirectory, setBindingExcludes, setBindingIncludes, setBindings, setBuildContext, setCatalog, setCatalogDirectory, setCatalogExcludes, setCatalogIncludes, setCatalogResolver, setCatalogs, setCleanPackageDirectories, setContentForWildcard, setDebug, setDisableDefaultExcludes, setDisableXmlSecurity, setEnableExternalEntityProcessing, setEnableIntrospection, setEncoding, setEpisode, setEpisodeFile, setEpisodes, setExtension, setForceRegenerate, setGenerateDirectory, setGeneratePackage, setLocale, setLocalRepository, setMarkGenerated, setMavenProjectBuilder, setNoFileHeader, setOtherDepends, setOtherDependsExcludes, setOtherDependsIncludes, setPackageLevelAnnotations, setPluginArtifacts, setPlugins, setProduces, setProject, setProxyHost, setProxyPassword, setProxyPort, setProxyUsername, setReadOnly, setRemoveOldOutput, setScanDependenciesForBindings, setSchemaDirectory, setSchemaExcludes, setSchemaIncludes, setSchemaLanguage, setSchemas, setSettings, setSpecVersion, setStrict, setUseActiveProxyAsHttpproxy, setUseDependenciesAsEpisodes, setVerbose, setWriteCode
-
-
-
-
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
-
-
Method Detail
-
getXjcPluginArtifacts
public Collection<org.apache.maven.artifact.Artifact> getXjcPluginArtifacts()
-
getXjcPluginFiles
public Collection<File> getXjcPluginFiles()
-
getEpisodeArtifacts
public Collection<org.apache.maven.artifact.Artifact> getEpisodeArtifacts()
-
getEpisodeFiles
public Collection<File> getEpisodeFiles()
-
getGrammars
protected List<InputSource> getGrammars()
-
getBindFiles
protected List<InputSource> getBindFiles()
-
createBindingURIs
protected List<URI> createBindingURIs() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionExecute 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.ArtifactResolutionExceptionorg.apache.maven.artifact.resolver.ArtifactNotFoundExceptionorg.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.ArtifactResolutionExceptionorg.apache.maven.artifact.resolver.ArtifactNotFoundExceptionorg.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 thecom.sun.tools.xjc.Options.findServicessystem 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() throws org.apache.maven.plugin.MojoExecutionExceptionLog the configuration settings. Shown when exception thrown or when verbose is true.- Overrides:
logConfigurationin classAbstractXJC2Mojo<O>- Throws:
org.apache.maven.plugin.MojoExecutionException
-
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.MojoExecutionExceptionCreates 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 (seeAbstractXJC2Mojo.getArgs()) but also include episode arguments.- Returns:
- String array of XJC command line options.
-
getHttpproxy
protected String getHttpproxy()
-
createOptionsConfiguration
public OptionsConfiguration createOptionsConfiguration() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-