我正在尝试将Ant构建的Java应用程序迁移到Maven2.其中构建执行以下操作:
运行javadoc doclet以查找带注释的Java文件,以便稍后将其外部化为Web服务
编译第3步的一小部分代码
在步骤2的已编译代码上运行Axis java2wsdl
在步骤3的WSDL文件中使用wsdl2java生成Java代码
编译整个代码
当试图"整合"过程时,我可以一次完成每项任务,但却无法按顺序完成所有任务.
为了演示我的pom并且不向您提供详细信息,我将展示以下代码段:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.6.1</version>
<executions>
<execution>
<id>aggregate</id>
<phase>generate-sources</phase>
<goals>
<goal>aggregate</goal>
</goals>
<configuration>...</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>compileWSfiles</id>
<goals>
<goal>compile</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<includes>
<!-- include 3 source files -->
</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>axistools-maven-plugin</artifactId>
<version>1.3</version>
<dependencies>
<dependency>
<groupId>axis</groupId>
<artifactId>axis</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>java2wsdl</id>
<phase>generate-sources</phase>
<goals>
<goal>java2wsdl</goal>
</goals>
<configuration>...</configuration>
</execution>
<execution>
<id>wsdl2java</id>
<phase>generate-sources</phase>
<goals>
<goal>wsdl2java</goal>
</goals>
<configuration>...</configuration>
</execution>
</executions> …Run Code Online (Sandbox Code Playgroud) 我正在尝试连接到第三方SOAP Web服务.当HTTP SOAPAction头是空字符串("")时,服务似乎可以工作.这是wsdl的片段:
<wsdl:binding name="detailsRequestMessage" type="tns:UssdPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="details">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
Run Code Online (Sandbox Code Playgroud)
你在哪里看到soapAction =""
我生成了一个stubis Axis2(1.5)wsdl2java.
我希望得到以下内容(使用SoapUI运行时成功输出):
POST /details HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: ""
User-Agent: Jakarta Commons-HttpClient/3.1
Host: some.host
Content-Length: 323
Run Code Online (Sandbox Code Playgroud)
但相反,我得到:
POST /details HTTP/1.1
Content-Type: text/xml; charset=UTF-8
SOAPAction: "http://some.url/wsussd/ussdtypes/UssdPortType/detailsRequest"
User-Agent: Axis2
Host: some.host
Content-Length: 300
Run Code Online (Sandbox Code Playgroud)
有谁知道这是什么问题或如何在程序中设置soapAction.
谢谢,罗恩
我正在尝试将 war 文件从公司的 Nexus 存储库复制到特定位置。我按以下方式使用maven-dependency-plugin :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<id>copy-to-output</id>
<phase>prepare-package</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.mycompany</groupId>
<artifactId>myproduct</artifactId>
<version>2.3.0</version>
<type>war</type>
<overWrite>false</overWrite>
</artifactItem>
</artifactItems>
<outputDirectory>${basedir}/src/main/output</outputDirectory>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
当我尝试使用<version>RELEASE</version>而不是特定版本(或根本没有版本)以获得最新的发行版本(虽然不是最佳实践,但在这种情况下它是安全的)时,问题就出现了 - 它不起作用。有什么想法吗?
我正在使用Maven2.我为我的组织创建了一个父POM.我希望各个小组将其用作项目的父级,但我希望他们使用最新版本.由于某种原因,使用它作为版本LATEST的父级不起作用,
任何的想法?
谢谢,罗恩.
什么更快?
out.writeObject(someString)或out.writeUTF(someString)