我正在使用Java8,我正在尝试使用jboss插件使用Web服务。
我尝试过 https://docs.jboss.org/author/display/JBWS/wsconsume 并遇到了很多兼容性问题
问题是我一直有很多依赖错误,我现在受够了。当前错误是无法找到 com.sun.istack:istack-commons-runtime:jar:1.1。我担心的是我是否需要这么多依赖项来运行简单的 wsconsumption?
<pluginRepositories>
<pluginRepository>
<id>JBOSS</id>
<name>JBoss Repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.jboss.jbossas</groupId>
<artifactId>jboss-as-client</artifactId>
<version>6.1.0.Final</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jboss.ws.plugins</groupId>
<artifactId>maven-jaxws-tools-plugin</artifactId>
<version>1.1.1.Final</version>
<executions>
<execution>
<id>My execution</id>
<goals>
<goal>wsconsume</goal>
</goals>
<configuration>
<wsdls>
<wsdl>mylocation?wsdl</wsdl>
</wsdls>
<targetPackage>src</targetPackage>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.jboss.ws.native</groupId>
<artifactId>jbossws-native-client</artifactId>
<version>3.3.1.GA</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.2.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-spi</artifactId>
<version>3.1.4.Final</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
</dependencies>
</plugin>
通过使用exec-maven-plugin而不是CRAPY JBoss插件执行wsconsumption.bat来解决
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<id>runbatchfile</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>${env.RH-SSO}/bin/wsconsume.bat</executable>
<arguments>
<argument>-o</argument>
<argument>${project.build.directory}classes</argument>
<argument>C:my.wsdl</argument>
</arguments>
</configuration>
</plugin>