Search in sources :

Example 1 with DocumentArtifact

use of org.apache.cxf.maven_plugin.common.DocumentArtifact in project cxf by apache.

the class AbstractCodeGeneratorMojo method downloadRemoteDocs.

protected void downloadRemoteDocs(List<WadlOption> effectiveOptions) throws MojoExecutionException {
    for (WadlOption option : effectiveOptions) {
        DocumentArtifact wadlA = option.getWadlArtifact();
        if (wadlA == null) {
            return;
        }
        Artifact wadlArtifact = repositorySystem.createArtifact(wadlA.getGroupId(), wadlA.getArtifactId(), wadlA.getVersion(), wadlA.getType());
        wadlArtifact = resolveRemoteWadlArtifact(wadlArtifact);
        if (wadlArtifact != null) {
            String path = wadlArtifact.getFile().getAbsolutePath();
            getLog().info("Resolved WADL artifact to file " + path);
            option.setWadl(path);
        }
    }
}
Also used : DocumentArtifact(org.apache.cxf.maven_plugin.common.DocumentArtifact) DocumentArtifact(org.apache.cxf.maven_plugin.common.DocumentArtifact) Artifact(org.apache.maven.artifact.Artifact)

Example 2 with DocumentArtifact

use of org.apache.cxf.maven_plugin.common.DocumentArtifact in project cxf by apache.

the class OptionLoader method generateWsdlOptionFromArtifact.

private static WadlOption generateWsdlOptionFromArtifact(Artifact artifact, File outputDir) {
    if (!WADL_TYPE.equals(artifact.getType())) {
        return null;
    }
    WadlOption option = new WadlOption();
    DocumentArtifact wsdlArtifact = new DocumentArtifact();
    wsdlArtifact.setArtifactId(artifact.getArtifactId());
    wsdlArtifact.setGroupId(artifact.getGroupId());
    wsdlArtifact.setType(artifact.getType());
    wsdlArtifact.setVersion(artifact.getVersion());
    option.setWadlArtifact(wsdlArtifact);
    option.setOutputDir(outputDir);
    return option;
}
Also used : DocumentArtifact(org.apache.cxf.maven_plugin.common.DocumentArtifact)

Aggregations

DocumentArtifact (org.apache.cxf.maven_plugin.common.DocumentArtifact)2 Artifact (org.apache.maven.artifact.Artifact)1