<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  JRedmine :: Client
  %%
  Copyright (C) 2009 - 2012 Tony Chemit, CodeLutin
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as 
  published by the Free Software Foundation, either version 3 of the 
  License, or (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Lesser Public License for more details.
  
  You should have received a copy of the GNU General Lesser Public 
  License along with this program.  If not, see
  <http://www.gnu.org/licenses/lgpl-3.0.html>.
  #L%
  -->

<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.nuiton</groupId>
    <artifactId>jredmine</artifactId>
    <version>1.5.1</version>
  </parent>

  <groupId>org.nuiton.jredmine</groupId>
  <artifactId>jredmine-client</artifactId>
  <name>JRedmine :: Client</name>
  <description>The JRedmine client</description>

  <properties>
    <!-- extra files to include in release -->
    <redmine.releaseFiles>
      target/${project.artifactId}-${project.version}-jredmine_rails-1.x.zip,
      target/${project.artifactId}-${project.version}-jredmine_rails-2.x.zip,
      ${redmine.libReleaseFiles}
    </redmine.releaseFiles>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.nuiton</groupId>
      <artifactId>helper-maven-plugin</artifactId>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <groupId>velocity</groupId>
          <artifactId>velocity</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-httpclient</groupId>
          <artifactId>commons-httpclient</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <scope>runtime</scope>
    </dependency>

    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpmime</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>

  </dependencies>

  <build>

    <plugins>
      <!-- expose new plexus components -->
      <plugin>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-metadata</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>

  <reporting>
    <excludeDefaults>true</excludeDefaults>
  </reporting>

  <profiles>

    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <reporting>
        <plugins>
          <plugin>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-maven-plugin</artifactId>
            <version>${plexusPluginVersion}</version>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>${coberturaPluginVersion}</version>
          </plugin>

        </plugins>
      </reporting>

    </profile>
    <profile>
      <id>assembly-profile</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>

          <!-- launch in a release the assembly, but not attach it to project -->

          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>create-assemblies</id>
                <phase>verify</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <attach>false</attach>
              <descriptorRefs>
                <descriptorRef>deps</descriptorRef>
                <descriptorRef>full</descriptorRef>
              </descriptorRefs>
              <descriptors>
                <descriptor>src/main/assembly/jredmine_rails-1.x.xml
                </descriptor>
                <descriptor>src/main/assembly/jredmine_rails-2.x.xml
                </descriptor>
              </descriptors>
            </configuration>
          </plugin>

        </plugins>

      </build>
    </profile>

    <profile>
      <id>run-client-its</id>
      <!--activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation-->
      <build>
        <defaultGoal>integration-test</defaultGoal>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <inherited>false</inherited>
            <configuration>
              <mergeUserSettings>true</mergeUserSettings>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <settingsFile>src/it/settings.xml</settingsFile>
              <localRepositoryPath>${project.build.directory}/local-repo
              </localRepositoryPath>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <pomIncludes>
                    <pomInclude>redmine-1.4.x/pom.xml</pomInclude>
                    <pomInclude>redmine-2.0.x/pom.xml</pomInclude>
                    <pomInclude>redmine-2.1.x/pom.xml</pomInclude>
                  </pomIncludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

</project>
