Post

Axis webservices with Maven overlays

1 tag

I should have published this months ago, so I hope I am not missing any details ... This short post shows how to build an Axis-based webservice, using Maven overlays.

I should have published this months ago, so I hope I am not missing any details ... This short post shows how to build an Axis-based webservice, using Maven overlays.

The first step is to add the required Axis dependencies:

<axis.version>1.5.1</axis.version>

<dependency>
  <groupId>org.apache.axis2</groupId>
 <artifactId>addressing</artifactId>
 <version>${axis.version}</version>
 <type>mar</type>
</dependency>

<dependency>
 <groupId>org.apache.axis2</groupId>
 <artifactId>mex</artifactId>
 <version>${axis.version}</version>
</dependency>

<dependency>
 <groupId>org.apache.axis2</groupId>
 <artifactId>mtompolicy</artifactId>
 <version>${axis.version}</version>
 <type>mar</type>
</dependency>

<dependency>
 <groupId>org.apache.axis2</groupId>
 <artifactId>ping</artifactId>
 <version>${axis.version}</version>
 <type>mar</type>
</dependency>

<dependency>
 <groupId>org.apache.axis2</groupId>
 <artifactId>soapmonitor</artifactId>
 <version>${axis.version}</version>
 <type>mar</type>
</dependency>

Then you can configure the war plugin so that the important part of Axis is exploded and included in the deliverable and the non-important parts are excluded:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.4</version>
    <configuration>
        <overlays>
            <overlay>
                <groupId>org.apache.axis2</groupId>
                <artifactId>axis2</artifactId>
                <includes>
                    <include>/WEB-INF/**</include>
                    <include>/axis2-web/**</include>
                </includes>
                <excludes>
                    <exclude>WEB-INF/lib/xerces*</exclude>
                    <exclude>WEB-INF/lib/xml*</exclude>
                    <exclude>WEB-INF/lib/Xml*</exclude>
                    <exclude>WEB-INF/conf/axis2.xml</exclude>
                    <exclude>WEB-INF/web.xml</exclude>
                </excludes>
            </overlay>
        </overlays>
    </configuration>
</plugin>

And that should do the trick.