小编rpe*_*rez的帖子

如何在Maven2构建中执行有序任务

我正在尝试将Ant构建的Java应用程序迁移到Maven2.其中构建执行以下操作:

  1. 运行javadoc doclet以查找带注释的Java文件,以便稍后将其外部化为Web服务

  2. 编译第3步的一小部分代码

  3. 在步骤2的已编译代码上运行Axis java2wsdl

  4. 在步骤3的WSDL文件中使用wsdl2java生成Java代码

  5. 编译整个代码

当试图"整合"过程时,我可以一次完成每项任务,但却无法按顺序完成所有任务.

为了演示我的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)

plugins binding maven-2 phase

6
推荐指数
1
解决办法
5421
查看次数

设置SOAPAction HTTP标头时出现Axis2问题

我正在尝试连接到第三方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.

谢谢,罗恩

axis2 web-services

5
推荐指数
1
解决办法
1万
查看次数

从 Maven 存储库复制工件的最新版本

我正在尝试将 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>而不是特定版本(或根本没有版本)以获得最新的发行版本(虽然不是最佳实践,但在这种情况下它是安全的)时,问题就出现了 - 它不起作用。有什么想法吗?

maven-2 version

5
推荐指数
2
解决办法
2557
查看次数

Maven中最新版本的父项目

我正在使用Maven2.我为我的组织创建了一个父POM.我希望各个小组将其用作项目的父级,但我希望他们使用最新版本.由于某种原因,使用它作为版本LATEST的父级不起作用,

任何的想法?

谢谢,罗恩.

maven-2 parent pom.xml

4
推荐指数
1
解决办法
4294
查看次数

Java writeObject Vs. writeUTF

什么更快?
out.writeObject(someString)或out.writeUTF(someString)

java stream

2
推荐指数
1
解决办法
5196
查看次数

标签 统计

maven-2 ×3

axis2 ×1

binding ×1

java ×1

parent ×1

phase ×1

plugins ×1

pom.xml ×1

stream ×1

version ×1

web-services ×1