<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.jenkins-ci</groupId>
    <artifactId>jenkins</artifactId>
    <version>1.17</version>
  </parent>
  
  <groupId>org.jenkins-ci.tools</groupId>
  <artifactId>maven-hpi-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  
  <name>Maven Jenkins Plugin</name>
  <version>1.72</version>
  <description>Maven2 plugin for developing Jenkins plugins</description>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>2.7</version>
        <configuration>
          <goalPrefix>hpi</goalPrefix>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <!-- maven resources plugin can't handle escapes, so we need to fall back to Ant to get the job done -->
            <phase>process-resources</phase>
            <configuration>
              <tasks>
                <ant antfile="${basedir}/copyArchetype.xml" />
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-apache-regexp</artifactId>
            <version>1.6.5</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>jakarta-regexp</groupId>
            <artifactId>jakarta-regexp</artifactId>
            <version>1.4</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
         <artifactId>wagon-ssh</artifactId>
         <version>1.0-beta-7</version>
      </extension>
    </extensions>
  </build>

  <properties>
    <!-- used for escape -->
    <begin>${${$}}{</begin>
    <end>$}</end>
    <dollar>$</dollar>
    <openbracket>{</openbracket>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.sun.codemodel</groupId>
      <artifactId>codemodel</artifactId>
      <version>2.1</version>
    </dependency>
    <dependency>
      <groupId>org.kohsuke.stapler</groupId>
      <artifactId>stapler-groovy</artifactId>
      <version>1.169</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>2.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-archiver</artifactId>
      <version>2.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>1.0.4</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>2.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <version>6.1.1</version>
    </dependency>
    <!-- for the create goal -->
    <dependency>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-archetype-plugin</artifactId>
      <version>1.0-alpha-4</version>
    </dependency>
    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-interactivity-api</artifactId>
      <version>1.0-alpha-4</version>
    </dependency>
    <!-- for using annotation processor -->
    <dependency>
      <groupId>org.kohsuke.stapler</groupId>
      <artifactId>maven-stapler-plugin</artifactId>
      <version>1.16</version>
      <!-- make sure to exclude servlet so that the one in Jetty (which has different groupId) will win -->
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>2.7</version>
      </plugin>
    </plugins>
  </reporting>
  
  <scm>
    <connection>scm:git:git://github.com/jenkinsci/maven-hpi-plugin.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/jenkinsci/maven-hpi-plugin.git</developerConnection>
    <url>https://github.com/jenkinsci/maven-hpi-plugin</url>
  </scm>

  <distributionManagement>
    <site>
      <id>jenkins-ci.org:/var/www</id>
      <url>scp://jenkins-ci.org/var/www/jenkins-ci.org/maven-hpi-plugin/</url>
    </site>
  </distributionManagement>

  <repositories>
    <repository>
      <id>m.g.o-public</id>
      <url>http://maven.glassfish.org/content/groups/public/</url>
    </repository>
  </repositories>

  <profiles>
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.5</version>
            <configuration>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${basedir}/target/local-repo</localRepositoryPath>
              <goals>
                <goal>clean</goal>
                <goal>site</goal>
              </goals>
              <settingsFile>src/it/settings.xml</settingsFile>
              <cloneProjectsTo>${project.build.directory}/its</cloneProjectsTo>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
