<?xml version='1.0' encoding='UTF-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF 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">
  <parent>
    <artifactId>maven-plugins</artifactId>
    <groupId>org.apache.maven.plugins</groupId>
    <version>10</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>maven-jar-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>Maven Jar Plugin</name>
  <version>2.2</version>
  <prerequisites>
    <maven>2.0.6</maven>
  </prerequisites>
  <issueManagement>
    <system>JIRA</system>
    <url>http://jira.codehaus.org/browse/MJAR</url>
  </issueManagement>
  
  <scm>
    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-jar-plugin-2.2</connection>
    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-jar-plugin-2.2</developerConnection>
    <url>http://svn.apache.org/viewvc/maven/plugins/tags/maven-jar-plugin-2.2</url>
  </scm>  
  
  <contributors>
    <contributor>
      <name>Jerome Lacoste</name>
      <email>jerome@coffeebreaks.org</email>
      <organization>CoffeeBreaks</organization>
      <organizationUrl>http://www.coffeebreaks.org</organizationUrl>
      <timezone>+1</timezone>
      <roles>
        <role>Java Developer</role>
      </roles>
    </contributor>
  </contributors>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0.6</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-project</artifactId>
      <version>2.0.7</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-archiver</artifactId>
      <version>2.3</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-archiver</artifactId>
      <version>1.0-alpha-9</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-container-default</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-io</artifactId>
      <version>1.0-alpha-1</version>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-container-default</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.codehaus.plexus</groupId>
          <artifactId>plexus-component-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>        
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.1</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>1.4.9</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.shared</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <version>1.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.3.1</version>  
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.0.4</version>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.0-alpha-3</version>
        <executions>
          <execution>
            <goals>
              <goal>enforce</goal>
            </goals>
            <id>ensure-no-container-api</id>
            <configuration>
              <rules>
                <bannedDependencies>
                  <excludes>
                    <exclude>org.codehaus.plexus:plexus-component-api</exclude>
                  </excludes>
                  <message>The new containers are not supported. You probably added a dependency that is missing the exclusions.</message>
                </bannedDependencies>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>      

      <!-- Testing the result of the it pom.xml -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.3</version>
        <configuration>
          <excludes>
            <exclude>**/*IntegrationTest.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>integration-tests</id>
      <activation>
        <property>
          <name>maven.test.skip</name>
          <value>!true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.2</version>
            <executions>
              <execution>
                <id>integration-test</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>install-file</goal>
                </goals>
                <configuration>
                  <file>${project.build.directory}/${project.build.finalName}.jar</file>
                  <groupId>${project.groupId}</groupId>
                  <artifactId>${project.artifactId}</artifactId>
                  <version>${project.version}</version>
                  <packaging>${project.packaging}</packaging>
                  <pomFile>${basedir}/pom.xml</pomFile>
                  <createChecksum>true</createChecksum>
                  <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                  <localRepositoryId>it-local-repo</localRepositoryId>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.1</version>
            <configuration>
              <projectsDirectory>src/it</projectsDirectory>
              <pomIncludes>
                <pomInclude>**/**/pom.xml</pomInclude>
              </pomIncludes>
              <postBuildHookScript>verify.bsh</postBuildHookScript>
              <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
              <goals>
                <goal>clean</goal>
                <goal>package</goal>
              </goals>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>
</project>
