Package org.apache.cxf.maven_plugin
Class AbstractCodegenMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.cxf.maven_plugin.AbstractCodegenMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
WSDL2JavaMojo
,WSDL2JavaScriptMojo
public abstract class AbstractCodegenMojo
extends org.apache.maven.plugin.AbstractMojo
-
Field Summary
Modifier and TypeFieldDescriptionprotected org.sonatype.plexus.build.incremental.BuildContext
protected String
protected boolean
By default all maven dependencies of type "wsdl" are added to the effective wsdlOptions.protected boolean
Disables the scanning of the wsdlRoot/testWsdlRoot directories.protected String[]
A list of wsdl files to exclude.protected String
Allows running the JavaToWs in a separate process.protected String[]
A list of wsdl files to include.protected File
Directory in which the "DONE" markers are saved thatprotected List<org.apache.maven.artifact.Artifact>
The plugin dependencies, needed for the fork modeprotected org.apache.maven.project.MavenProject
protected boolean
protected File
protected boolean
Use the compile classpath rather than the test classpath for execution useful if the test dependencies clash with those of wsdl2javaprotected File
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPluginArtifact
(Set<URI> artifactsPath) protected void
protected void
createMarkerFile
(GenericWsdlOption wsdlOption, File doneFile, URI wsdlURI) protected abstract List<GenericWsdlOption>
protected boolean
Recursively delete the given directoryprotected void
downloadRemoteWsdls
(List<GenericWsdlOption> effectiveWsdlOptions) void
execute()
protected void
forkOnce
(Set<URI> classPath, List<GenericWsdlOption> effectiveWsdlOptions) protected abstract Bus
generate
(GenericWsdlOption o, Bus bus, Set<URI> cp) generateCommandLine
(GenericWsdlOption wsdlOption) protected File
getDoneFile
(URI basedir, URI wsdlURI, String mojo) protected abstract Class<?>
protected abstract File
protected abstract File
protected abstract String
getWsdlFile
(GenericWsdlOption option, File baseDir) Try to find a file matching the wsdl path (either absolutely, relatively to the current dir or to the project base dir)getWsdlURI
(GenericWsdlOption option, URI baseURI) protected void
protected abstract boolean
shouldRun
(GenericWsdlOption wsdlOption, File doneFile, URI wsdlURI) Determine if code should be generated from the given wsdlMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
classesDirectory
@Parameter(property="project.build.outputDirectory", required=true) protected String classesDirectory -
disableDependencyScan
@Parameter(property="cxf.disableDependencyScan", defaultValue="false") protected boolean disableDependencyScanBy default all maven dependencies of type "wsdl" are added to the effective wsdlOptions. Setting this parameter to true disables this functionality -
disableDirectoryScan
@Parameter(property="cxf.disableDirectoryScan", defaultValue="false") protected boolean disableDirectoryScanDisables the scanning of the wsdlRoot/testWsdlRoot directories. By default, we scan for *.wsdl (see include/exclude params as well) in the wsdlRoot directories and run the tool on all the wsdls we find. This disables that scan and requires an explicit wsdlOption to be set for each wsdl that needs to be processed. -
fork
Allows running the JavaToWs in a separate process. Valid values are "false", "always", and "once" The value of "true" is equal to "once" -
includes
A list of wsdl files to include. Can contain ant-style wildcards and double wildcards. Defaults to *.wsdl -
markerDirectory
@Parameter(property="cxf.markerDirectory", defaultValue="${project.build.directory}/cxf-codegen-plugin-markers") protected File markerDirectoryDirectory in which the "DONE" markers are saved that -
pluginArtifacts
@Parameter(required=true, readonly=true, property="plugin.artifacts") protected List<org.apache.maven.artifact.Artifact> pluginArtifactsThe plugin dependencies, needed for the fork mode -
project
@Parameter(required=true, property="project") protected org.apache.maven.project.MavenProject project -
useCompileClasspath
@Parameter(property="cxf.useCompileClasspath", defaultValue="false") protected boolean useCompileClasspathUse the compile classpath rather than the test classpath for execution useful if the test dependencies clash with those of wsdl2java -
excludes
A list of wsdl files to exclude. Can contain ant-style wildcards and double wildcards. -
testWsdlRoot
@Parameter(property="cxf.testWsdlRoot", defaultValue="${basedir}/src/test/resources/wsdl") protected File testWsdlRoot -
wsdlRoot
@Parameter(property="cxf.wsdlRoot", defaultValue="${basedir}/src/main/resources/wsdl") protected File wsdlRoot -
skipGarbageCollection
@Parameter(property="cxf.skipGarbageCollection", defaultValue="false") protected boolean skipGarbageCollection -
buildContext
@Component protected org.sonatype.plexus.build.incremental.BuildContext buildContext
-
-
Constructor Details
-
AbstractCodegenMojo
public AbstractCodegenMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
generate
protected abstract Bus generate(GenericWsdlOption o, Bus bus, Set<URI> cp) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
addPluginArtifact
-
configureProxyServerSettings
protected void configureProxyServerSettings() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createWsdlOptionsFromScansAndExplicitWsdlOptions
protected abstract List<GenericWsdlOption> createWsdlOptionsFromScansAndExplicitWsdlOptions() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
deleteDir
Recursively delete the given directory- Parameters:
f
-- Returns:
-
getMarkerSuffix
-
generateCommandLine
protected List<String> generateCommandLine(GenericWsdlOption wsdlOption) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
forkOnce
protected void forkOnce(Set<URI> classPath, List<GenericWsdlOption> effectiveWsdlOptions) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
getForkClass
-
getDoneFile
-
getGeneratedSourceRoot
-
getGeneratedTestRoot
-
runForked
protected void runForked(Set<URI> classPath, String mainClassName, String[] args) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
shouldRun
Determine if code should be generated from the given wsdl- Parameters:
wsdlOption
-doneFile
-wsdlURI
-- Returns:
-
createMarkerFile
protected void createMarkerFile(GenericWsdlOption wsdlOption, File doneFile, URI wsdlURI) throws IOException - Throws:
IOException
-
getWsdlFile
Try to find a file matching the wsdl path (either absolutely, relatively to the current dir or to the project base dir)- Returns:
- wsdl file
-
getWsdlURI
public URI getWsdlURI(GenericWsdlOption option, URI baseURI) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
downloadRemoteWsdls
protected void downloadRemoteWsdls(List<GenericWsdlOption> effectiveWsdlOptions) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-