Search code examples
maven-2apache-axismaven-plugin

aar file not added into war axis2-aar-maven-plugin


I am trying to careate a sample webservice with Axis2 and Maven, while the aar file is generating but in aar, as war file get generated first and aar file afterwordds. can someone provide some help here.

<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>


Solution

  • Issue resolved. I have done following changes into 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>