Apache CXF API

org.apache.cxf.maven_plugin
Class AbstractCodegenMoho

java.lang.Object
  extended by AbstractMojo
      extended by org.apache.cxf.maven_plugin.AbstractCodegenMoho
Direct Known Subclasses:
WSDL2JavaMojo, WSDL2JavaScriptMojo

public abstract class AbstractCodegenMoho
extends AbstractMojo


Field Summary
protected  BuildContext buildContext
           
protected  String classesDirectory
           
protected  boolean disableDependencyScan
          By default all maven dependencies of type "wsdl" are added to the effective wsdlOptions.
protected  boolean disableDirectoryScan
          Disables the scanning of the wsdlRoot/testWsdlRoot directories.
protected  String[] excludes
          A list of wsdl files to exclude.
protected  String fork
          Allows running the JavaToWs in a separate process.
protected  String[] includes
          A list of wsdl files to include.
protected  File markerDirectory
          Directory in which the "DONE" markers are saved that
protected  List<Artifact> pluginArtifacts
          The plugin dependencies, needed for the fork mode.
protected  MavenProject project
           
protected  File testWsdlRoot
           
protected  boolean useCompileClasspath
          Use the compile classpath rather than the test classpath for execution useful if the test dependencies clash with those of wsdl2java
protected  File wsdlRoot
           
 
Constructor Summary
AbstractCodegenMoho()
           
 
Method Summary
protected  void addPluginArtifact(Set<URI> artifactsPath)
           
protected  void configureProxyServerSettings()
           
protected abstract  List<GenericWsdlOption> createWsdlOptionsFromScansAndExplicitWsdlOptions()
           
protected  boolean deleteDir(File f)
          Recursively delete the given directory
protected  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)
           
protected  List<String> generateCommandLine(GenericWsdlOption wsdlOption)
           
protected  File getDoneFile(URI basedir, URI wsdlURI, String mojo)
           
protected abstract  Class<?> getForkClass()
           
protected abstract  File getGeneratedSourceRoot()
           
protected abstract  File getGeneratedTestRoot()
           
protected abstract  String getMarkerSuffix()
           
 File 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)
 URI getWsdlURI(GenericWsdlOption option, URI baseURI)
           
protected  void runForked(Set<URI> classPath, String mainClassName, String[] args)
           
protected abstract  boolean shouldRun(GenericWsdlOption wsdlOption, File doneFile, URI wsdlURI)
          Determine if code should be generated from the given wsdl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classesDirectory

protected String classesDirectory

disableDependencyScan

protected boolean disableDependencyScan
By default all maven dependencies of type "wsdl" are added to the effective wsdlOptions. Setting this parameter to true disables this functionality


disableDirectoryScan

protected boolean disableDirectoryScan
Disables 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

protected String fork
Allows running the JavaToWs in a separate process. Valid values are "false", "always", and "once" The value of "true" is equal to "once"

Since:
2.4

includes

protected String[] includes
A list of wsdl files to include. Can contain ant-style wildcards and double wildcards. Defaults to *.wsdl


markerDirectory

protected File markerDirectory
Directory in which the "DONE" markers are saved that


pluginArtifacts

protected List<Artifact> pluginArtifacts
The plugin dependencies, needed for the fork mode.


project

protected MavenProject project

useCompileClasspath

protected boolean useCompileClasspath
Use the compile classpath rather than the test classpath for execution useful if the test dependencies clash with those of wsdl2java


excludes

protected String[] excludes
A list of wsdl files to exclude. Can contain ant-style wildcards and double wildcards.


testWsdlRoot

protected File testWsdlRoot

wsdlRoot

protected File wsdlRoot

buildContext

protected BuildContext buildContext
Constructor Detail

AbstractCodegenMoho

public AbstractCodegenMoho()
Method Detail

execute

public void execute()
             throws MojoExecutionException
Throws:
MojoExecutionException

generate

protected abstract Bus generate(GenericWsdlOption o,
                                Bus bus,
                                Set<URI> cp)
                         throws MojoExecutionException
Throws:
MojoExecutionException

addPluginArtifact

protected void addPluginArtifact(Set<URI> artifactsPath)

configureProxyServerSettings

protected void configureProxyServerSettings()
                                     throws MojoExecutionException
Throws:
MojoExecutionException

createWsdlOptionsFromScansAndExplicitWsdlOptions

protected abstract List<GenericWsdlOption> createWsdlOptionsFromScansAndExplicitWsdlOptions()
                                                                                     throws MojoExecutionException
Throws:
MojoExecutionException

deleteDir

protected boolean deleteDir(File f)
Recursively delete the given directory

Parameters:
f -
Returns:

getMarkerSuffix

protected abstract String getMarkerSuffix()

generateCommandLine

protected List<String> generateCommandLine(GenericWsdlOption wsdlOption)
                                    throws MojoExecutionException
Throws:
MojoExecutionException

forkOnce

protected void forkOnce(Set<URI> classPath,
                        List<GenericWsdlOption> effectiveWsdlOptions)
                 throws MojoExecutionException
Throws:
MojoExecutionException

getForkClass

protected abstract Class<?> getForkClass()

getDoneFile

protected File getDoneFile(URI basedir,
                           URI wsdlURI,
                           String mojo)

getGeneratedSourceRoot

protected abstract File getGeneratedSourceRoot()

getGeneratedTestRoot

protected abstract File getGeneratedTestRoot()

runForked

protected void runForked(Set<URI> classPath,
                         String mainClassName,
                         String[] args)
                  throws MojoExecutionException
Throws:
MojoExecutionException

shouldRun

protected abstract boolean shouldRun(GenericWsdlOption wsdlOption,
                                     File doneFile,
                                     URI wsdlURI)
Determine if code should be generated from the given wsdl

Parameters:
wsdlOption -
doneFile -
wsdlURI -
Returns:

getWsdlFile

public File 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)

Returns:
wsdl file

getWsdlURI

public URI getWsdlURI(GenericWsdlOption option,
                      URI baseURI)
               throws MojoExecutionException
Throws:
MojoExecutionException

downloadRemoteWsdls

protected void downloadRemoteWsdls(List<GenericWsdlOption> effectiveWsdlOptions)
                            throws MojoExecutionException
Throws:
MojoExecutionException

Apache CXF API

Apache CXF