Search in sources :

Example 11 with GenericWsdlOption

use of org.apache.cxf.maven_plugin.GenericWsdlOption in project cxf by apache.

the class WSDL2JavaScriptMojo method createWsdlOptionsFromScansAndExplicitWsdlOptions.

@Override
protected List<GenericWsdlOption> createWsdlOptionsFromScansAndExplicitWsdlOptions() throws MojoExecutionException {
    List<GenericWsdlOption> effectiveWsdlOptions = new ArrayList<>();
    List<GenericWsdlOption> temp;
    if (wsdlOptions != null) {
        for (WsdlOption wo : wsdlOptions) {
            effectiveWsdlOptions.add(wo);
        }
    }
    if (wsdlRoot != null && wsdlRoot.exists() && !disableDirectoryScan) {
        temp = loadWsdlOptionsFromFiles(wsdlRoot, getGeneratedSourceRoot());
        effectiveWsdlOptions.addAll(temp);
    }
    if (testWsdlRoot != null && testWsdlRoot.exists() && !disableDirectoryScan) {
        temp = loadWsdlOptionsFromFiles(testWsdlRoot, getGeneratedTestRoot());
        effectiveWsdlOptions.addAll(temp);
    }
    if (!disableDependencyScan) {
        temp = loadWsdlOptionsFromDependencies(project, defaultOptions, getGeneratedSourceRoot());
        effectiveWsdlOptions.addAll(temp);
    }
    mergeOptions(effectiveWsdlOptions);
    downloadRemoteWsdls(effectiveWsdlOptions);
    return effectiveWsdlOptions;
}
Also used : GenericWsdlOption(org.apache.cxf.maven_plugin.GenericWsdlOption) GenericWsdlOption(org.apache.cxf.maven_plugin.GenericWsdlOption) ArrayList(java.util.ArrayList)

Example 12 with GenericWsdlOption

use of org.apache.cxf.maven_plugin.GenericWsdlOption in project cxf by apache.

the class WSDL2JavaScriptMojo method mergeOptions.

protected void mergeOptions(List<GenericWsdlOption> effectiveWsdlOptions) {
    File outputDirFile = getGeneratedTestRoot() == null ? getGeneratedSourceRoot() : getGeneratedTestRoot();
    for (GenericWsdlOption wo : effectiveWsdlOptions) {
        WsdlOption option = (WsdlOption) wo;
        option.merge(defaultOptions);
        if (option.getOutput() == null) {
            option.setOutput(outputDirFile);
        }
    }
}
Also used : GenericWsdlOption(org.apache.cxf.maven_plugin.GenericWsdlOption) GenericWsdlOption(org.apache.cxf.maven_plugin.GenericWsdlOption) File(java.io.File)

Aggregations

GenericWsdlOption (org.apache.cxf.maven_plugin.GenericWsdlOption)12 ArrayList (java.util.ArrayList)8 File (java.io.File)7 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)6 Artifact (org.apache.maven.artifact.Artifact)4 URI (java.net.URI)3 URISyntaxException (java.net.URISyntaxException)3 IOException (java.io.IOException)2 LinkedHashSet (java.util.LinkedHashSet)2 ToolContext (org.apache.cxf.tools.common.ToolContext)2 DataInputStream (java.io.DataInputStream)1 DataOutputStream (java.io.DataOutputStream)1 OutputStream (java.io.OutputStream)1 OutputStreamCreator (org.apache.cxf.tools.util.OutputStreamCreator)1 WSDLToJava (org.apache.cxf.tools.wsdlto.WSDLToJava)1 WSDLToJavaScript (org.apache.cxf.tools.wsdlto.javascript.WSDLToJavaScript)1