2

我正在尝试使用 Axis2 和 Maven 来处理示例 web 服务,而 aar 文件正在生成但在 aar 中,因为首先生成了 war 文件,然后生成了 aar 文件。有人可以在这里提供一些帮助。

<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.prash</groupId>
<artifactId>test.webservice</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>test.webservice Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.2.1-b03</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2</artifactId>
        <version>1.6.2</version>
        <type>pom</type>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-aar-maven-plugin</artifactId>
        <version>1.6.2</version>
        <type>maven-plugin</type>
    </dependency>
    <dependency>
        <groupId>axis2</groupId>
        <artifactId>axis2-xmlbeans</artifactId>
        <version>1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.axis2</groupId>
        <artifactId>axis2-adb</artifactId>
        <version>1.6.2</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.axis2</groupId>
            <artifactId>axis2-aar-maven-plugin</artifactId>
            <version>1.6.2</version>
            <extensions>true</extensions>

            <configuration>
            <!--  Set true  if you want Depending Jar to be included into AAR file-->
            <includeDependencies>false</includeDependencies>
                <aarName>StockQuoteService</aarName>
                <outputDirectory>${basedir}/src/webapp/</outputDirectory>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>aar</goal>
                    </goals>
                </execution>

            </executions>
        </plugin>
    </plugins>
    <finalName>test.webservice</finalName>

</build>

4

1 回答 1

2

问题解决了。我已经对 pom.xml 进行了以下更改

<plugins>
            <plugin>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2-aar-maven-plugin</artifactId>
                <version>1.6.2</version>
                <extensions>true</extensions>
                <configuration>
                <!--  Set true  if you want Depending Jar to be included into AAR file-->
                <includeDependencies>false</includeDependencies>
                    <aarName>StockQuoteService</aarName>
                    <outputDirectory>${basedir}/target/test.webservice/WEB-INF/services</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>aar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
于 2013-02-13T11:10:39.877 回答