<?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>
		<groupId>org.fusesource</groupId>
		<artifactId>camel-sap-parent</artifactId>
		<version>3.20.1.redhat-00089</version>
	</parent>

	<artifactId>camel-sap</artifactId>
	<packaging>bundle</packaging>

	<name>JBoss Fuse :: Components :: SAP JCO :: Camel Component</name>
	<description>Provides SAP Camel Component Layer</description>
	<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>

		<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>camel-support</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.sap.conn.jco</groupId>
			<artifactId>sapjco3</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.sap.conn.idoc</groupId>
			<artifactId>sapidoc3</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.change</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-simple</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-test-junit5</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>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-test-spring-junit5</artifactId>
			<type>bundle</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-inline</artifactId>
			<version>${mockito.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-library</artifactId>
			<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.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>${maven.compiler.target}</source>
					<target>${maven.compiler.source}</target>
				</configuration>
				<executions>
					<execution>
						<id>recompile</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<phase>process-classes</phase>
					</execution>
				</executions>
			</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-SymbolicName>org.fusesource.camel-sap</Bundle-SymbolicName>
						<Bundle-Activator>org.fusesource.camel.component.sap.Activator</Bundle-Activator>
						<Bundle-Name>${project.name}</Bundle-Name>
						<Bundle-Vendor>Red Hat</Bundle-Vendor>
						<Bundle-DocURL>http://fabric.fusesource.org/</Bundle-DocURL>
						<Export-Package> org.fusesource.camel.component.sap;version=${project.version};-split-package:=merge-first, 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
						</Export-Package>
						<Import-Package> org.eclipse.*;resolution:=optional, org.eclipse.core.runtime;version=!;resolution:=optional, org.osgi.framework;version=!, org.fusesource.camel.component.sap.model.idoc;resolution:=optional, org.fusesource.camel.component.sap.model.rfc;resolution:=optional,
							*
						</Import-Package>
						<Private-Package> org.eclipse.emf.common.*, org.eclipse.emf.ecore.*, org.eclipse.emf.edit.*, org.fusesource.camel.component.sap.*;-split-package:=merge-first
						</Private-Package>
						<Implementation-Title>Fabric8</Implementation-Title>
						<Implementation-Version>${project.version}</Implementation-Version>
						<Export-Service>org.apache.camel.spi.ComponentResolver;component=sap</Export-Service>
					</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>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
							<goal>add-resource</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/generated/java</source>
							</sources>
							<resources>
								<resource>
									<directory>src/generated/resources</directory>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-component-maven-plugin</artifactId>
				<version>${camel-community-version}</version>
				<executions>
					<execution>
						<id>generate</id>
						<goals>
							<goal>generate</goal>
						</goals>
						<phase>process-classes</phase>
					</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>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>2.10</version>
					<executions>
						<execution>
							<id>manual-purge-local-repository</id>
							<phase>deploy</phase>
							<goals>
								<goal>purge-local-repository</goal>
							</goals>
							<configuration>
								<manualIncludes>
									<manualInclude>com.sap.conn.idoc:com.sap.conn.idoc</manualInclude>
									<manualInclude>com.sap.conn.jco:com.sap.conn.jco</manualInclude>
								</manualIncludes>
								<reResolve>false</reResolve>
								<actTransitively>false</actTransitively>
								<verbose>true</verbose>
								<resolutionFuzziness>groupId</resolutionFuzziness>
							</configuration>
						</execution>
					</executions>
					<dependencies>
						<dependency>
							<groupId>com.sun.xml.bind</groupId>
							<artifactId>jaxb-core</artifactId>
							<version>2.3.0.redhat-1</version>
						</dependency>
						<dependency>
							<groupId>com.sun.xml.bind</groupId>
							<artifactId>jaxb-impl</artifactId>
							<version>2.3.0</version>
						</dependency>
					</dependencies>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<repositories>
		
		
	</repositories>

	<profiles>
		<profile>
			<id>it</id>
			<properties>
				<!-- SAP Instance Configuration Configuration Parameters -->
				<!-- *** Please enter the connection property values for your SAP Instance *** -->
				<jco.client.ashost>10.0.15.218</jco.client.ashost>
				<jco.client.sysnr>01</jco.client.sysnr>
				<jco.client.client>000</jco.client.client>
				<jco.client.gwhost>10.0.15.218</jco.client.gwhost>
				<jco.client.gwserv>3301</jco.client.gwserv>
				<jco.client.user>DEVELOPER</jco.client.user>
				<jco.client.passwd>R3dh4tsap</jco.client.passwd>
			</properties>
			<build>
				<testResources>
					<testResource>
						<directory>src/test/resources</directory>
						<filtering>true</filtering>
					</testResource>
				</testResources>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<executions>
							<execution>
								<id>integration-test</id>
								<phase>verify</phase>
								<goals>
									<goal>integration-test</goal>
									<goal>verify</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<argLine>-Djava.library.path="${native.lib.directory}"</argLine>
							<reuseForks>true</reuseForks>
						</configuration>
					</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>
							<skipTests>${skip.surefire.tests}</skipTests>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
