<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">
  <parent>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>modules-plus</artifactId>
    <version>7.0.0.pre5</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>jetty-jndi</artifactId>
  <name>Jetty Plus :: JNDI Naming</name>
  <description>JNDI spi impl for java namespace.</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>clean</id>
            <phase>clean</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <delete failonerror="false" includeemptydirs="true">
                  <fileset dir="../../../lib" includes="jndi/**" />
                </delete>
              </tasks>
            </configuration>
          </execution>
          <execution>
            <phase>install</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <copy file="target/${project.artifactId}-${project.version}.${project.packaging}" tofile="../../../lib/jndi/${project.artifactId}-${project.version}.${project.packaging}" />
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <executions>
          <execution>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <instructions>
                <Bundle-RequiredExecutionEnvironment>J2SE-1.5</Bundle-RequiredExecutionEnvironment>
                <Import-Package>!org.mortbay.naming.*,*</Import-Package>
                <Bundle-SymbolicName>org.mortbay.naming</Bundle-SymbolicName>
                <Bundle-DocURL>http://jetty.mortbay.org</Bundle-DocURL>
              </instructions>
            </configuration>
           </execution>
        </executions>
      </plugin>
      <plugin>
        <!--
        Required for OSGI
        -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>               
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-deps</id>
            <phase>install</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>javax.mail</groupId>
                  <artifactId>mail</artifactId>
                  <version>${mail-version}</version>
                </artifactItem>
              </artifactItems>
              <outputDirectory>../../../lib/jndi</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>	  
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-webapp</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
      <version>${mail-version}</version>
	  <exclusions>
	    <exclusion>
		  <groupId>javax.activation</groupId>
		  <artifactId>activation</artifactId>
		</exclusion>
	  </exclusions>
    </dependency>
  </dependencies>
  <profiles>
    <profile>
      <id>below-jdk1.6</id>
      <activation>
        <jdk>!1.6</jdk>
      </activation>
	  <build>
	    <plugins>
		  <plugin>
			<artifactId>maven-dependency-plugin</artifactId>
			<executions>
			  <execution>
			    <id>copy-deps-below1.6</id>
				<phase>install</phase>
				<goals>
				  <goal>copy</goal>
				</goals>
				<configuration>
				  <artifactItems>
					<artifactItem>
					  <groupId>javax.activation</groupId>
					  <artifactId>activation</artifactId>
					  <version>${activation-version}</version>
					</artifactItem>
				  </artifactItems>
				  <outputDirectory>../../../lib/jndi</outputDirectory>
				</configuration>				
			  </execution>
			</executions>
		  </plugin>
		</plugins>
	  </build>
      <dependencies>
		<dependency>
		  <groupId>javax.activation</groupId>
		  <artifactId>activation</artifactId>
		  <version>${activation-version}</version>
		</dependency>	  
      </dependencies>
    </profile>
  </profiles>  
</project>
