Class 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 Detail

      • classesDirectory

        @Parameter(property="project.build.outputDirectory",
                   required=true)
        protected String classesDirectory
      • disableDependencyScan

        @Parameter(property="cxf.disableDependencyScan",
                   defaultValue="false")
        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

        @Parameter(property="cxf.disableDirectoryScan",
                   defaultValue="false")
        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

        @Parameter(defaultValue="false")
        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"
      • includes

        @Parameter
        protected String[] 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 markerDirectory
        Directory in which the "DONE" markers are saved that
      • pluginArtifacts

        @Parameter(required=true,
                   readonly=true,
                   property="plugin.artifacts")
        protected List<org.apache.maven.artifact.Artifact> pluginArtifacts
        The 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 useCompileClasspath
        Use the compile classpath rather than the test classpath for execution useful if the test dependencies clash with those of wsdl2java
      • excludes

        @Parameter
        protected String[] 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 Detail

      • AbstractCodegenMojo

        public AbstractCodegenMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • generate

        protected abstract org.apache.cxf.Bus generate​(GenericWsdlOption o,
                                                       org.apache.cxf.Bus bus,
                                                       Set<URI> cp)
                                                throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • addPluginArtifact

        protected void addPluginArtifact​(Set<URI> artifactsPath)
      • 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

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

        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 org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.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 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