<?xml version="1.0" encoding="UTF-8"?>

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

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

    <parent>
        <groupId>org.apache.camel</groupId>
        <artifactId>camel-parent</artifactId>
        <version>1.6.1</version>
    </parent>

    <artifactId>camel-script</artifactId>
    <packaging>bundle</packaging>
    <name>Camel :: Script</name>
    <description>Camel Script support</description>

    <properties>
        <camel.osgi.export.pkg>org.apache.camel.builder.script.*</camel.osgi.export.pkg>
    </properties>

    <repositories>
        <!-- SMX Repository is more up to date than LogicBlaze repo -->
        <repository>
            <id>servicemix</id>
            <name>ServiceMix Repository</name>
            <url>http://svn.apache.org/repos/asf/servicemix/m2-repo</url>
        </repository>
        <repository>
            <id>codehause.mule-deps</id>
            <name>Codehause Mule Dependencies Repository</name>
            <url>http://dist.codehaus.org/mule/dependencies/maven2</url>
        </repository>
    </repositories>

    <dependencies>

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring-version}</version>
        </dependency>

        <dependency>
            <groupId>javax.script</groupId>
            <artifactId>script-api</artifactId>
            <version>1.0</version>
        </dependency>

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>

        <!-- ServiceMix Repo Script Engines -->
        <dependency>
            <groupId>com.sun.script</groupId>
            <artifactId>groovy-engine</artifactId>
            <version>20080611</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.script</groupId>
            <artifactId>js-engine</artifactId>
            <version>20080611</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.script</groupId>
            <artifactId>jython-engine</artifactId>
            <version>20080611</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.script</groupId>
            <artifactId>jruby-engine</artifactId>
            <version>20080611</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.sun.script</groupId>
            <artifactId>bsh-engine</artifactId>
            <version>20080611</version>
            <scope>test</scope>
        </dependency>

        <!-- testing -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <type>test-jar</type>
            <optional>true</optional>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-spring</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>rhino</groupId>
            <artifactId>js</artifactId>
            <version>1.6R7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.python</groupId>
            <artifactId>jython</artifactId>
            <version>2.2.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby</artifactId>
            <version>1.1.4</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.beanshell</groupId>
            <artifactId>bsh</artifactId>
            <version>2.0b5</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>pertest</forkMode>
                    <childDelegation>false</childDelegation>
                    <useFile>true</useFile>
                    <includes>
                        <include>**/*Test.*</include>
                    </includes>
                    <!-- TODO: beanshell doesnt work on java 5 yet with the bsh-engine we got in pom right now -->
                    <excludes>
                        <exclude>**/BeanShellScriptRouteTest.*</exclude>
                        <exclude>**/BeanShellFilterTest.*</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <profiles>
      <profile>
        <id>on-ibmjdk</id>
        <activation>
          <property>
            <name>java.vendor</name>
            <value>IBM Corporation</value>
          </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <forkMode>pertest</forkMode>
                        <childDelegation>false</childDelegation>
                        <useFile>true</useFile>
                        <includes>
                            <include>**/*Test.*</include>
                        </includes>
                        <!-- TODO: beanshell doesnt work on java 5 yet with the bsh-engine we got in pom right now -->
                        <!-- TODO: Ruby scripting doesn't work on IBM's JDK 
                                   See http://jira.codehaus.org/browse/JRUBY-3073 -->
                        <excludes>
                            <exclude>**/BeanShellScriptRouteTest.*</exclude>
                            <exclude>**/BeanShellFilterTest.*</exclude>
                            <exclude>**/Ruby*Test.*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
            </plugins>
        </build>
      </profile>
    </profiles>    
</project>
