<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2015 Red Hat, Inc. Red Hat 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>
		<artifactId>camel-sap-parent</artifactId>
		<groupId>org.fusesource</groupId>
		<version>6.3.0.redhat-340</version>
	</parent>

	<artifactId>camel-sap</artifactId>
	<packaging>bundle</packaging>

	<name>JBoss Fuse :: Components :: SAP JCO :: Camel Component</name>
	<url>http://http://www.jboss.org/products/fuse/overview/</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<fuse.osgi.activator>org.fusesource.camel.component.sap.Activator</fuse.osgi.activator>
		<fuse.osgi.import>
			org.eclipse.*;resolution:=optional,
			*
		</fuse.osgi.import>
		<fuse.osgi.export>
			org.fusesource.camel.component.sap;version=${project.version},
			org.fusesource.camel.component.sap.converter;version=${project.version},
			org.fusesource.camel.component.sap.model.rfc;version=${project.version},
			org.fusesource.camel.component.sap.model.rfc.impl;version=${project.version},
			org.fusesource.camel.component.sap.model.idoc;version=${project.version},
			org.fusesource.camel.component.sap.model.idoc.impl;version=${project.version},
			org.fusesource.camel.component.sap.util;version=${project.version},
			org.eclipse.emf.ecore,
			org.eclipse.emf.ecore.util,
			org.eclipse.emf.common.util
		</fuse.osgi.export>
		<fuse.osgi.private.pkg>
			org.eclipse.emf.common.*,
			org.eclipse.emf.ecore.*,
			org.eclipse.emf.edit.*,
			org.fusesource.camel.component.sap.*;-split-package:=merge-first
		</fuse.osgi.private.pkg>
		<fuse.osgi.services.export>org.apache.camel.spi.ComponentResolver;component=sap</fuse.osgi.services.export>
		<native.lib.directory>${project.build.directory}/jni</native.lib.directory>
		<lib.directory>${project.build.directory}/lib</lib.directory>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>apt</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.common</artifactId>
			<scope>compile</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.ecore</artifactId>
			<scope>compile</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.ecore.xmi</artifactId>
			<scope>compile</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.eclipse.emf</groupId>
			<artifactId>org.eclipse.emf.edit</artifactId>
			<scope>compile</scope>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.fusesource</groupId>
			<artifactId>org.fusesource.camel.component.sap</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.fusesource</groupId>
			<artifactId>org.fusesource.camel.component.sap.model</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-test-spring</artifactId>
			<type>bundle</type>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.sap.conn.jco</groupId>
			<artifactId>sapjco3</artifactId>
			<scope>system</scope>
			<systemPath>${lib.directory}/sapjco3.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>com.sap.conn.idoc</groupId>
			<artifactId>sapidoc3</artifactId>
			<scope>system</scope>
			<systemPath>${lib.directory}/sapidoc3.jar</systemPath>
		</dependency>
		<dependency>
			<groupId>com.sap.conn.jco</groupId>
			<artifactId>com.sap.conn.jco</artifactId>
			<version>3.0.11.redhat_2</version>
		</dependency>
		<dependency>
			<groupId>com.sap.conn.idoc</groupId>
			<artifactId>com.sap.conn.idoc</artifactId>
			<version>3.0.10.redhat_2</version>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-library</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-integration</artifactId>
		</dependency>
		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-module-junit4</artifactId>
			<version>1.5.6</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.powermock</groupId>
			<artifactId>powermock-api-mockito</artifactId>
			<version>1.5.6</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<build>
		<defaultGoal>install</defaultGoal>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<excludeDependencies>${fuse.osgi.exclude.dependencies}</excludeDependencies>
					<instructions>
						<Bundle-Name>${fuse.osgi.bundle.name}</Bundle-Name>
						<Bundle-SymbolicName>${fuse.osgi.symbolic.name}</Bundle-SymbolicName>
						<Bundle-DocURL>http://fabric.fusesource.org/</Bundle-DocURL>
						<Bundle-Activator>${fuse.osgi.activator}</Bundle-Activator>
						<Export-Package>${fuse.osgi.export}</Export-Package>
						<Import-Package>${fuse.osgi.import}</Import-Package>
						<DynamicImport-Package>${fuse.osgi.dynamic}</DynamicImport-Package>
						<Private-Package>${fuse.osgi.private.pkg}</Private-Package>
						<Implementation-Title>Fabric8</Implementation-Title>
						<Implementation-Version>${project.version}</Implementation-Version>
						<Include-Resource>${fuse.osgi.resource}</Include-Resource>
						<_versionpolicy>${fuse.osgi.import.default.version}</_versionpolicy>
						<_failok>${fuse.osgi.failok}</_failok>

						<Export-Service>${fuse.osgi.services.export}</Export-Service>

						<Embed-Dependency>${fuse.osgi.embed.dependency}</Embed-Dependency>
						<Embed-Transitive>${fuse.osgi.embed.transitive}</Embed-Transitive>
						<Require-Bundle>${fuse.osgi.require.bundle}</Require-Bundle>
						<Require-Capability>${fuse.osgi.capabilities.require}</Require-Capability>
						<Provide-Capability>${fuse.osgi.capabilities.provide}</Provide-Capability>

						<Service-Component>${fuse.osgi.service.component}</Service-Component>

					</instructions>
				</configuration>
				<executions>
					<execution>
						<id>cleanVersions</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>cleanVersions</goal>
						</goals>
						<configuration>
							<versions>
								<karaf.osgi.version>${karaf-version}</karaf.osgi.version>
							</versions>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-artifacts</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>target/classes/features.xml</file>
									<type>xml</type>
									<classifier>features</classifier>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-native-lib-for-unit-tests</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<stripVersion>true</stripVersion>
							<outputDirectory>${native.lib.directory}</outputDirectory>
							<artifactItems>
								<artifactItem>
									<groupId>com.sap.conn.jco</groupId>
									<artifactId>sapjco3</artifactId>
									<type>${envType}</type>
									<classifier>${envClassifier}</classifier>
									<overWrite>true</overWrite>
									<destFileName>${native.lib.filename}.${envType}</destFileName>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
					<execution>
						<id>copy-jco-libs-unit-tests</id>
						<phase>validate</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<stripVersion>true</stripVersion>
							<outputDirectory>${lib.directory}</outputDirectory>
							<artifactItems>
								<artifactItem>
									<groupId>com.sap.conn.jco</groupId>
									<artifactId>sapjco3</artifactId>
									<overWrite>true</overWrite>
									<destFileName>sapjco3.jar</destFileName>
								</artifactItem>
								<artifactItem>
									<groupId>com.sap.conn.idoc</groupId>
									<artifactId>sapidoc3</artifactId>
									<overWrite>true</overWrite>
									<destFileName>sapidoc3.jar</destFileName>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<reuseForks>false</reuseForks><!-- Added to resolve issues with multiple 
						loading of JCo native library -->
					<argLine>-Djava.library.path="${native.lib.directory}"</argLine>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-package-maven-plugin</artifactId>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-dependency-plugin
										</artifactId>
										<versionRange>
											[2.1,)
										</versionRange>
										<goals>
											<goal>copy</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.camel
										</groupId>
										<artifactId>
											camel-package-maven-plugin
										</artifactId>
										<versionRange>
											[2.15.1.redhat-621084,)
										</versionRange>
										<goals>
											<goal>
												generate-components-list
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<description>Provides SAP Camel Component Layer</description>

	<repositories>
		<repository>
			<id>fusesource-third-party-internal</id>
			<url>https://repository.jboss.org/nexus/content/repositories/fs-releases/</url>
			<layout>default</layout>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
			<releases>
				<enabled>true</enabled>
			</releases>
		</repository>
		<repository>
            <id>brewroot</id>
            <name>Brew Repository</name>
            <url>http://download.eng.bos.redhat.com/brewroot/repos/jb-fuse-6.2-build/latest/maven</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
        </repository>		
	</repositories>

</project>
