<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2007 the original author or authors. Licensed 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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.grails</groupId>
    <artifactId>grails-maven-plugin</artifactId>
    <version>2.4.0</version>
    <packaging>maven-plugin</packaging>

    <name>Maven plugin for GRAILS applications</name>
    <description>This plugin allows you to integrate GRAILS applications into maven 2 builds.</description>
    <url>http://github.com/grails/grails-maven</url>
    <licenses>
        <license>
          <name>The Apache Software License, Version 2.0</name>
          <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
          <distribution>repo</distribution>
        </license>    
    </licenses>
    <scm>
      <url>http://github.com/grails/grails-maven-plugin</url>
      <developerConnection>scm:git:git://github.com/grails/grails-maven-plugin.git</developerConnection>
      <connection>scm:git:git@github.com:grails/grails-maven-plugin.git</connection>
    </scm>
    <developers>
      <developer>
        <id>graemerocher</id>
        <name>Graeme Rocher</name>
        <email>graeme.rocher@gmail.com</email>
      </developer>
    </developers>

    <parent>
      <groupId>org.sonatype.oss</groupId>
      <artifactId>oss-parent</artifactId>
      <version>7</version>
    </parent>
    
    <properties>
        <!-- Prerequisites -->
        <maven.version>3.1.0</maven.version>

        <!-- Dependencies -->
        <groovy.version>2.3.1</groovy.version>
        <grails.version>2.4.0</grails.version>
        <grails-launcher.version>1.0.5</grails-launcher.version>
        <aether.version>0.9.1.v20140329</aether.version>
        <maven-model.version>${maven.version}</maven-model.version>
        <maven-plugin-api.version>${maven.version}</maven-plugin-api.version>
        <maven-project.version>2.2.1</maven-project.version>
        <maven-archiver.version>2.2</maven-archiver.version>
        <plexus-utils.version>1.4.5</plexus-utils.version>
        <junit.version>4.11</junit.version>
        <maven-plugin-testing-harness.version>3.1.0</maven-plugin-testing-harness.version>
        <xmlunit.version>1.0</xmlunit.version>
    </properties>

    <prerequisites>
        <maven>${maven.version}</maven>
    </prerequisites>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.grails</groupId>
                <artifactId>grails-bootstrap</artifactId>
                <version>${grails.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.springframework.uaa</groupId>
                        <artifactId>org.springframework.uaa.client</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <dependencies>
        <dependency>
            <groupId>jline</groupId>
            <artifactId>jline</artifactId>
            <version>2.11</version>
        </dependency>

        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-bootstrap</artifactId>
        </dependency>

        <dependency>
            <!-- required in all cases -->
            <groupId>org.eclipse.aether</groupId>
            <artifactId>aether-api</artifactId>
            <version>${aether.version}</version>
        </dependency>

        <dependency>
            <!-- optional helpers, might be superfluous depending on your use case -->
            <groupId>org.eclipse.aether</groupId>
            <artifactId>aether-util</artifactId>
            <version>${aether.version}</version>
        </dependency>

        <dependency>
             <groupId>org.codehaus.groovy</groupId>
             <artifactId>groovy-all</artifactId>
             <version>${groovy.version}</version>
         </dependency>                


        <dependency>
            <groupId>org.grails</groupId>
            <artifactId>grails-launcher</artifactId>
            <version>${grails-launcher.version}</version>
        </dependency>


        <dependency>
            <groupId>org.eclipse.jdt.core.compiler</groupId>
            <artifactId>ecj</artifactId>
            <version>3.7.1</version>            
            <scope>runtime</scope>
        </dependency>
        

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.maven</groupId>
                    <artifactId>maven-model</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.maven</groupId>
                    <artifactId>maven-artifact</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.eclipse.sisu</groupId>
                    <artifactId>org.eclipse.sisu.plexus</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${maven-model.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-settings</artifactId>
            <version>${maven.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>${plexus-utils.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.plugin-testing</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>3.1.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-compat</artifactId>
            <version>3.1.0</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>xmlunit</groupId>
            <artifactId>xmlunit</artifactId>
            <version>${xmlunit.version}</version>
            <scope>test</scope>
        </dependency>



    </dependencies>

    <build>
        <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <executions>
                <execution>
                  <id>sign-artifacts</id>
                  <phase>verify</phase>
                  <goals>
                    <goal>sign</goal>
                  </goals>
                </execution>
              </executions>
            </plugin>
                        
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generated-helpmojo</id>
                        <goals>
                            <goal>helpmojo</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                        <phase>process-sources</phase>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-resources/plexus</outputDirectory>
                        </configuration>
                    </execution>

                    <execution>
                        <id>merge</id>
                        <goals>
                            <goal>merge-descriptors</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>
                                    ${project.build.directory}/generated-resources/plexus/META-INF/plexus/components.xml
                                </descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-docck-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.17</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>jdk_windows</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>1.6</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>jdk_unix</id>
            <activation>
                <os>
                    <family>unix</family>
                    <name>!mac os x</name> <!-- needed due to MNG-4983 -->
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>1.6</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/../lib/tools.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

</project>
