<?xml version="1.0" encoding="utf-8"?>
<!--
 ~ Copyright (c) 2009-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 ~
 ~ Licensed 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.
-->

<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">

    <parent>
        <groupId>org.wso2.carbon</groupId>
        <artifactId>bpel</artifactId>
        <version>3.0.0</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>org.wso2.carbon.bpel.ode.integration</artifactId>
    <packaging>bundle</packaging>
    <name>WSO2 Carbon - BPEL ODE-Axis2 Integration</name>
    <url>http://wso2.org</url>
    <description>ODE-Axis2 Integration Layer</description>

    <dependencies>
        <dependency>
            <groupId>org.apache.axis2.wso2</groupId>
            <artifactId>axis2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.utils</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.synapse</groupId>
            <artifactId>synapse-commons</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.ode.wso2</groupId>
            <artifactId>ode</artifactId>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.security.mgt</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections.wso2</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
	<dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.logging</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <excludes>
                        <exclude>**/EndpointConfTest.java</exclude>
                        <exclude>**/RegConfTestCase.java</exclude>
                    </excludes>
                    <forkMode>pertest</forkMode>
                    <argLine>-enableassertions</argLine>
                    <testFailureIgnore>false</testFailureIgnore>
                    <systemProperties>
                        <property>
                            <name>log4j.configuration</name>
                            <value>file:src/test/resources/test-log4j.properties</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>xmlbeans-maven-plugin</artifactId>
                <version>2.3.3</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>xmlbeans</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <schemaDirectory>src/main/resources/schemas</schemaDirectory>
                    <xmlConfigs>
                        <xmlConfig implementation="java.io.File">src/main/resources/schemas/xmlbeans.conf</xmlConfig>
                    </xmlConfigs>
                    <noUpa>false</noUpa>
                    <sourceGenerationDirectory>
                        target/generated-code/src
                    </sourceGenerationDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.1</version>
                <executions>
                    <execution>
                        <id>source-code-generation</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/main/resources/wsdls/process_management.wsdl -uw -ss -sd
                                    -o target/generated-code -p org.wso2.carbon.bpel.ode.integration.management
                                    -ns2p http://wso2.org/bps/management/schema=org.wso2.carbon.bpel.ode.integration.management.types,http://wso2.org/bps/management/wsdl/ProcessManagement=org.wso2.carbon.bpel.ode.integration.management"/>
                                    <classpath refid="maven.dependency.classpath"/>
                                    <classpath refid="maven.compile.classpath"/>
                                    <classpath refid="maven.runtime.classpath"/>
                                </java>
                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/main/resources/wsdls/instance_management.wsdl -uw -ss -sd
                                    -o target/generated-code -p org.wso2.carbon.bpel.ode.integration.management
                                    -ns2p http://wso2.org/bps/management/schema=org.wso2.carbon.bpel.ode.integration.management.types,http://wso2.org/bps/management/wsdl/InstanceManagement=org.wso2.carbon.bpel.ode.integration.management"/>
                                    <classpath refid="maven.dependency.classpath"/>
                                    <classpath refid="maven.compile.classpath"/>
                                    <classpath refid="maven.runtime.classpath"/>
                                </java>
                                <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true">
                                    <arg line="-uri src/main/resources/wsdls/bpelpackage_management.wsdl -uw -ss -sd
                                    -o target/generated-code -p org.wso2.carbon.bpel.ode.integration.management
                                    -ns2p http://wso2.org/bps/management/schema=org.wso2.carbon.bpel.ode.integration.management.types,http://wso2.org/bps/management/wsdl/BPELPackageManagement=org.wso2.carbon.bpel.ode.integration.management"/>
                                    <classpath refid="maven.dependency.classpath"/>
                                    <classpath refid="maven.compile.classpath"/>
                                    <classpath refid="maven.runtime.classpath"/>
                                </java>
                                <delete file="target/generated-code/src/org/wso2/carbon/bpel/ode/integration/management/ProcessManagementServiceSkeleton.java"
                                        verbose="true" failonerror="true"/>
                                <delete file="target/generated-code/src/org/wso2/carbon/bpel/ode/integration/management/InstanceManagementServiceSkeleton.java"
                                        verbose="true" failonerror="true"/>
                                <delete file="target/generated-code/src/org/wso2/carbon/bpel/ode/integration/management/BPELPackageManagementServiceSkeleton.java"
                                        verbose="true" failonerror="true"/>
                                <copy file="target/generated-code/resources/bps_management.xsd"
                                      tofile="src/main/resources/META-INF/bps_management.xsd" verbose="true"
                                      overwrite="true"/>
                                <copy file="target/generated-code/resources/ProcessManagementService.wsdl"
                                      tofile="src/main/resources/META-INF/ProcessManagementService.wsdl" verbose="true"
                                      overwrite="true"/>
                                <copy file="target/generated-code/resources/ProcessManagementService.wsdl"
                                      tofile="src/main/resources/META-INF/InstanceManagementService.wsdl" verbose="true"
                                      overwrite="true"/>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>target/generated-code/src</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>1.4.0</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${pom.artifactId}</Bundle-Name>
                        <Export-Package>
                            org.wso2.carbon.bpel.ode.integration.*
                        </Export-Package>
                        <Import-Package>
                            !org.wso2.carbon.bpel.ode.integration,
                            !org.wso2.carbon.bpel.ode.integration.store,
                            org.apache.ode.*,
                            org.apache.axis2.*; version="${axis2.osgi.version.range.bpel}",
                            javax.transaction.*,
                            *;resolution:=optional
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
