如何使用cxf-wadl2java-plugin从远程wadl生成存根?

时间:2019-06-17 15:05:20

标签: jax-rs cxf cxfrs

如何使用“ cxf-wadl2java-plugin”从远程wadl生成存根? 如我所知,使用“ cxf-wadl2java-plugin”从物理wadl生成存根。但是,我想从远程wadl生成存根。 我已经尝试了以下插件代码配置,但是没有用。

<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-wadl2java-plugin</artifactId>
<version>3.1.5</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/target/generated-sources</sourceRoot>
<wadlOptions>
<wadlOption>
<wadl>http://localhost:8086/test/api/v10?_wadl</wadl>
<impl>true</impl>
<!-- <authentication>apiuser:apiuser</authentication> -->
<!-- <authorization>apiuser:apiuser</authorization> -->
<packagename>com.sree.resource</packagename>
</wadlOption>
</wadlOptions>
</configuration>
<goals>
<goal>wadl2java</goal>
</goals>
</execution>
</executions>
</plugin>

我在下面使用放置在项目特定目录上的物理wad进行了尝试。可以了但是,我的期望是从远程wadl生成存根。     

<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-wadl2java-plugin</artifactId>
<version>3.1.5</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/target/generated-sources</sourceRoot>
<wadlOptions>
<wadlOption>
<wadl>${basedir}/src/main/resources/wadl/testResource.wadl</wadl>
<impl>true</impl>
<packagename>com.sree.resource</packagename>
</wadlOption>
</wadlOptions>
</configuration>
<goals>
<goal>wadl2java</goal>
</goals>
</execution>
</executions>
</plugin>

而且,我尝试使用org.jvnet.ws.wadl的“ wadl-client-plugin”成功地从远程wadl生成存根。

<plugin>
<groupId>org.jvnet.ws.wadl</groupId>
<artifactId>wadl-client-plugin</artifactId>
<version>1.1.6</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>${basedir}/target/generated-sources</sourceRoot>
<generationStyle>jaxrs20</generationStyle>
<targets>
<url>http://localhost:8086/test/api/v10?_wadl</url>
</targets>
<autoPackaging>true</autoPackaging>
<packageName>com.sree.resource</packageName>
<customClassNames>
<property>
<name>http://localhost:8086/test/api/v10</name>
<value>TEST_V10_API</value>
</property>
</customClassNames>
</configuration>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>

但是,我不要这个。我希望它使用apache cxf-cxf-wadl2java-plugin生成。怎么样?

0 个答案:

没有答案