<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

    <!--

        Licensed to the Apache Software Foundation (ASF) under one or more
        contributor license agreements.  See the NOTICE file distributed with
        this work for additional information regarding copyright ownership.
        The ASF licenses this file to You under the Apache License, Version 2.0
        (the "License"); you may not use this file except in compliance with
        the License.  You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

        Unless required by applicable law or agreed to in writing, software
        distributed under the License is distributed on an "AS IS" BASIS,
        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
        See the License for the specific language governing permissions and
        limitations under the License.
    -->

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.servicemix</groupId>
        <artifactId>service-engines</artifactId>
        <version>2013.01</version>
    </parent>

    <groupId>org.apache.servicemix</groupId>
    <artifactId>servicemix-jsr181</artifactId>
    <packaging>jbi-component</packaging>
    <name>Apache ServiceMix :: Components :: JSR-181 Service Engine</name>
    <description>
        ServiceMix JSR(181 component is a JBI Service Engine exposing (annotated) POJO as services on the JBI Bus. It uses xfire internally to perform service invocations and xml marshaling.
    </description>

    <properties>
        <xfire.version>1.2.5</xfire.version>
        <servicemix.osgi.import>
            !org.apache.servicemix.jsr181*,
            !META-INF.services.org.apache.xbean.spring.http.servicemix.apache.org.jsr181,
            org.apache.servicemix.common,
            org.apache.servicemix.common.osgi,
            org.apache.servicemix.executors.impl,
            org.apache.servicemix.jbi.container*;resolution:=optional,
            org.apache.servicemix.jbi.framework*;resolution:=optional,
            org.apache.xbean.spring.context.v2,
            org.springframework.beans.factory.xml,
            org.codehaus.xfire*,
            javax.xml.bind*,
            sun.misc;resolution:=optional,
            *
        </servicemix.osgi.import>
        <servicemix.osgi.export>
            org.apache.servicemix.jsr181*;version=${project.version},
            META-INF.services.org.apache.xbean.spring.http.servicemix.apache.org.jsr181
        </servicemix.osgi.export>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml.stream</groupId>
            <artifactId>stax-api</artifactId>
        </dependency>        
        <dependency>
            <groupId>jdom</groupId>
            <artifactId>jdom</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-jta_1.1_spec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix</groupId>
            <artifactId>servicemix-shared</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.woodstox</groupId>
            <artifactId>woodstox-core-asl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.xfire</groupId>
            <artifactId>xfire-jaxb2</artifactId>
            <version>${xfire.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>stax</groupId>
                    <artifactId>stax-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>httpunit</groupId>
                    <artifactId>httpunit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>jetty</groupId>
                    <artifactId>org.eclipse.jetty</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-beanutils</groupId>
                    <artifactId>commons-beanutils</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>qdox</groupId>
                    <artifactId>qdox</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.codehaus.xfire</groupId>
            <artifactId>xfire-jaxws</artifactId>
            <version>${xfire.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.codehaus.xfire</groupId>
            <artifactId>xfire-xmlbeans</artifactId>
            <version>${xfire.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>httpunit</groupId>
                    <artifactId>httpunit</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>jetty</groupId>
                    <artifactId>org.eclipse.jetty</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.activation</groupId>
                    <artifactId>activation</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ant</groupId>
                    <artifactId>ant</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-beanutils</groupId>
                    <artifactId>commons-beanutils</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>qdox</groupId>
                    <artifactId>qdox</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xmlParserAPIs</artifactId>
        </dependency>
        <dependency>
            <groupId>wsdl4j</groupId>
            <artifactId>wsdl4j</artifactId>
        </dependency>
        
        <!-- provided -->
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-javamail_1.4_spec</artifactId>
            <scope>provided</scope>
        </dependency>        
        <dependency>
            <groupId>org.apache.servicemix.specs</groupId>
            <artifactId>org.apache.servicemix.specs.jbi-api-1.0</artifactId>
            <scope>provided</scope>
        </dependency>
        
        <!-- test -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>        
        <dependency>
            <groupId>org.apache.servicemix</groupId>
            <artifactId>servicemix-core</artifactId>
            <scope>test</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-jmx</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


        <!-- documentation -->
        <dependency>
            <groupId>org.apache.servicemix</groupId>
            <artifactId>servicemix-common</artifactId>
            <classifier>sources</classifier>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!--
            <plugin>
              <artifactId>maven-antrun-plugin</artifactId>
              <executions>
                <execution>
                  <phase>generate-resources</phase>
                  <configuration>
                    <tasks>
                      <taskdef classname="org.apache.xbean.spring.generator.MappingGeneratorTask" name="mapping">
                        <classpath>
                          <pathelement path="${basedir}/target/classes" />
                          <path refid="maven.test.classpath" />
                        </classpath>
                      </taskdef>
                      <mapping destFile="${basedir}/target/servicemix-jsr181-${version}.xsd" namespace="http://servicemix.apache.org/jsr181/1.0" srcdir="${basedir}/src/main/java" metaInfDir="${basedir}/target/generated/" />
                    </tasks>
                  </configuration>
                  <goals>
                    <goal>run</goal>
                  </goals>
                </execution>
              </executions>
              <dependencies>
                <dependency>
                  <groupId>qdox</groupId>
                  <artifactId>qdox</artifactId>
                  <version>${qdox.version}</version>
                </dependency>
              </dependencies>
            </plugin>
            -->
            <plugin>
                <groupId>org.apache.xbean</groupId>
                <artifactId>maven-xbean-plugin</artifactId>
                <executions>
                    <execution>
                        <configuration>
                            <namespace>http://servicemix.apache.org/jsr181/1.0</namespace>
                        </configuration>
                        <goals>
                            <goal>mapping</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>jbi-maven-plugin</artifactId>
                <configuration>
                    <type>service-engine</type>
                    <component>org.apache.servicemix.jsr181.Jsr181Component</component>
                    <serviceUnitAnalyzerClass>org.apache.servicemix.jsr181.packaging.Jsr181ServiceUnitAnalyzer</serviceUnitAnalyzerClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <!-- exclude abstract test cases -->
                        <exclude>**/Abstract*.*</exclude>
                        <exclude>**/Jsr181SpringTest.*</exclude>
                        <exclude>**/Jsr181SpringProxyTest.*</exclude>
                        <exclude>**/Jsr181ProxySUTest.*</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!--
      Checkstyle chokes on files containing non-ascii characters when
      using the ibmjdk, so add a profile here to allow skipping those
      source files.
    -->
    <profiles>
        <profile>
            <id>ibmjdk</id>
            <activation>
                <property>
                    <name>java.vendor</name>
                    <value>IBM Corporation</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.servicemix</groupId>
                                <artifactId>build</artifactId>
                                <version>${servicemix.version}</version>
                            </dependency>
                        </dependencies>
                        <!-- Skip Jsr181ComplexPojoTest.java -->
                        <configuration>
                            <excludes>**/Jsr181ComplexPojoTest.java</excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
