<?xml version="1.0" encoding="UTF-8"?>
<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>com.sun.enterprise</groupId>
        <artifactId>hk2-parent</artifactId>
        <version>1.0.40</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>auto-depends</artifactId>
    <name>Inversion of Control / Autodependency mechanism</name>
    <description>${project.name}</description>
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/classes</outputDirectory>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.glassfish.hk2</groupId>
                                    <artifactId>class-model</artifactId>
                                    <version>${project.version}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.jvnet</groupId>
                                    <artifactId>tiger-types</artifactId>
                                    <version>1.2</version>
                                </artifactItem>                                
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>${project.groupId}</groupId>
                <artifactId>osgiversion-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <!-- This is needed so that the manifest generated by
                        maven-bundle-plugin:manifest goal is picked up by
                        maven-jar-plugin. -->
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <dependencies>
   		<dependency>
            <groupId>org.jvnet</groupId>
            <artifactId>tiger-types</artifactId>
            <version>1.2</version>
            <optional>true</optional>
        </dependency>
   		<dependency>
        	<groupId>org.glassfish.hk2</groupId>
            <artifactId>class-model</artifactId>
            <version>${project.version}</version>
            <optional>true</optional>
        </dependency>
   		<dependency>
        	<groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.3.1</version>
            <optional>true</optional>
            <scope>provided</scope>
        </dependency>
        <dependency>
        	<groupId>org.glassfish.hk2.external</groupId>
            <artifactId>asm-all-repackaged</artifactId>
            <version>${project.version}</version>
         </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>jdk5</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <jdk>1.5</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.xml.stream</groupId>
                    <artifactId>stax-api</artifactId>
                    <version>1.0-2</version>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
