我正在为JBoss(或Wildfly)服务器构建一个Web服务应用程序。在其中,它调用另一个Web服务。我使用Maven进行依赖,构建和测试。我的POM文件如下:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>[GROUPID]</groupId>
<artifactId>DocGen</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<groupId>[GROUPID]</groupId>
<artifactId>DocGenWS</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>DocGenData</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<artifactId>commonj.sdo</artifactId>
<groupId>org.eclipse.persistence</groupId>
</exclusion>
<exclusion>
<artifactId>javax.persistence</artifactId>
<groupId>org.eclipse.persistence</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>EA3</version>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<exclusions>
<exclusion>
<artifactId>jms</artifactId>
<groupId>javax.jms</groupId>
</exclusion>
<exclusion>
<artifactId>jmxri</artifactId>
<groupId>com.sun.jmx</groupId>
</exclusion>
<exclusion>
<artifactId>jmxtools</artifactId>
<groupId>com.sun.jdmk</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<finalName>DocGenWS</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.12</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<debug>true</debug>
<debuglevel>lines,vars,source</debuglevel>
<optimize>true</optimize>
<showwarnings>true</showwarnings>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsgen</goal>
</goals>
<phase>process-classes</phase>
<configuration>
<sei>com.nicetech.tigo.docgen.ws.DocGen</sei>
<genWsdl>true</genWsdl>
<keep>true</keep>
<verbose>true</verbose>
<protocol>Xsoap1.2</protocol>
<extension>true</extension>
<inlineSchemas>true</inlineSchemas>
</configuration>
</execution>
<execution>
<id>wsimport-iface</id>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlDirectory>src/main/resources/wsdl</wsdlDirectory>
<wsdlFiles>
<wsdlFile>sso_wsefactura.asmx.wsdl</wsdlFile>
</wsdlFiles>
<keep>true</keep>
<packageName>gt.com.megaprint.webservice</packageName>
<sourceDestDir>target/generated-code/src</sourceDestDir>
<verbose>true</verbose>
</configuration>
</execution>
<execution>
<id>wsimport-notification</id>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
<wsdlUrls>
<wsdlUrl>http://wlstest-srv.tigo.com.gt:8011/TIGOAPIServicios/SendNotificationRI/ProxyServices/SendNotificationRIPS_?wsdl</wsdlUrl>
</wsdlUrls>
<keep>true</keep>
<packageName>gt.com.tigo.notification</packageName>
<sourceDestDir>target/generated-code/src</sourceDestDir>
<verbose>true</verbose>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-code/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
</project>
我生成的WSDL位于target/jaxws/wsgen/wsdl
及其架构,但它不包含在生成的WAR
包中。当我将它部署到JBoss时,Webservices选项卡为空,在包中没有显示WS。我使用ANT并没有任何问题,但依赖管理和自动构建是一个活生生的地狱。
有什么想法吗?
编辑:WSgen输出
warning: The apt tool and its associated API are planned to be
removed in the next major JDK release. These features have been
superseded by javac and the standardized annotation processing API,
javax.annotation.processing and javax.lang.model. Users are
recommended to migrate to the annotation processing features of
javac; see the javac man page for more information.
Note: ap round: 1
[ProcessedMethods Class: com.nicetech.tigo.docgen.ws.DocGen]
[should process method: emitirDocumentoElectronico hasWebMethods: true ]
[endpointReferencesInterface: false]
[declaring class has WebSevice: true]
[returning: true]
[WrapperGen - method: emitirDocumentoElectronico(java.lang.String,java.lang.String,java.util.Date,java.lang.String,java.lang.String[],com.nicetech.tigo.docgen.ws.obj.EmitirDocumentoEncabezado,com.nicetech.tigo.docgen.ws.obj.EmitirDocumentoOpcional,com.nicetech.tigo.docgen.ws.obj.EmitirDocumentoDetalle)]
[method.getDeclaringType(): com.nicetech.tigo.docgen.ws.DocGen]
[requestWrapper: com.nicetech.tigo.docgen.ws.jaxws.EmitirDocumentoElectronico]
[ProcessedMethods Class: java.lang.Object]
com\nicetech\tigo\docgen\ws\jaxws\EmitirDocumentoElectronico.java
com\nicetech\tigo\docgen\ws\jaxws\EmitirDocumentoElectronicoResponse.java
Note: ap round: 2