<!-- Copyright (C) 2010-2012 Andrei Pozolotin <Andrei.Pozolotin@gmail.com> 
	All rights reserved. Licensed under the OSI BSD License. http://www.opensource.org/licenses/bsd-license.php -->
<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">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>com.carrotgarden.base</groupId>
		<artifactId>carrot-archon</artifactId>
		<version>1.3.0</version>
	</parent>

	<groupId>com.carrotgarden.wrap</groupId>
	<artifactId>carrot-wrap-jgit</artifactId>
	<version>2.2.0-build001</version>
	<packaging>bundle</packaging>

	<scm>
		<url>https://github.com/carrot-garden/carrot-wrap-jgit</url>
		<connection>scm:git:git://github.com/carrot-garden/carrot-wrap-jgit.git</connection>
		<developerConnection>scm:git:ssh://git@github.com/carrot-garden/carrot-wrap-jgit.git</developerConnection>
		<tag>carrot-wrap-jgit-2.2.0-build001</tag>
	</scm>

	<repositories>

		<repository>
			<id>jgit</id>
			<url>http://download.eclipse.org/jgit/maven</url>
		</repository>

	</repositories>

	<properties>

		<jgitVersion>2.2.0.201212191850-r</jgitVersion>

		<unpackSource>target/unpack-source</unpackSource>

	</properties>

	<dependencies>

		<!-- -->
		<dependency>
			<groupId>org.eclipse.jgit</groupId>
			<artifactId>org.eclipse.jgit</artifactId>
			<version>${jgitVersion}</version>
			<optional>true</optional>
			<exclusions>
				<exclusion>
					<groupId>com.jcraft</groupId>
					<artifactId>jsch</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

	</dependencies>

	<build>

		<plugins>

			<!-- unpack source -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack-source</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>unpack-dependencies</goal>
						</goals>
						<configuration>
							<classifier>sources</classifier>
							<includeScope>compile</includeScope>
							<failOnMissingClassifierArtifact>false</failOnMissingClassifierArtifact>
							<outputDirectory>${unpackSource}</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- register source folder -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>register-source</id>
						<goals>
							<goal>add-source</goal>
						</goals>
						<phase>prepare-package</phase>
						<configuration>
							<sources>
								<path>${unpackSource}</path>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- attach source jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- attach javadocs jar : skip -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<skip>true</skip>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- produce bundle -->
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<configuration>
					<instructions>
						<_failok>true</_failok>
						<_removeheaders>
							Service-Component,
							Include-Resource,
							Private-Package,
							Ignore-Package,
							Embed-Dependency,
							Embed-Transitive,
						</_removeheaders>
						<Import-Package>
							*,
						</Import-Package>
						<Embed-Dependency>
							*;scope=compile;inline=true,
						</Embed-Dependency>
						<Embed-Transitive>true</Embed-Transitive>
						<Export-Package>
							org.eclipse.jgit.*;version=${jgitVersion},
						</Export-Package>
					</instructions>
				</configuration>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>build-helper-maven-plugin</artifactId>
										<versionRange>[0,)</versionRange>
										<goals>
											<goal>add-source</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>

		</pluginManagement>

	</build>

</project>
