<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mysema.scalagen</groupId>
  <artifactId>scalagen_${scala.version}</artifactId>
  <version>0.3.2</version>
  <name>Scalagen</name>
    
  <parent>
    <groupId>com.mysema.home</groupId>
    <artifactId>mysema-source</artifactId>
    <version>0.3.0</version>
  </parent>
  
  <packaging>jar</packaging>

  <inceptionYear>2011</inceptionYear>
  
  <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>
    <connection>scm:git:git@github.com:mysema/scalagen.git</connection>
    <url>git@github.com:mysema/scalagen.git</url>
  </scm>    
    
  <properties>
    <commons.collections.version>4.01</commons.collections.version>
    <commons.lang.version>3.0.1</commons.lang.version>
    <querydsl.version>2.3.0</querydsl.version>
  </properties>
  
  <profiles>
    <profile>
      <id>scala-2.9.x</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <scala.version>2.9.3</scala.version>
        <scalaArm.scalaVersion>2.9.2</scalaArm.scalaVersion>
      </properties>
    </profile>
    
    <profile>
      <id>scala-2.10.x</id>
      <properties>
        <scala.version>2.10.1</scala.version>
        <scalaArm.scalaVersion>2.10</scalaArm.scalaVersion>
      </properties>
    </profile>
  </profiles>
  
  <dependencies>
    <dependency>
      <groupId>com.google.code.javaparser</groupId>
      <artifactId>javaparser</artifactId>
      <version>1.0.10</version>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.collections</groupId>
      <artifactId>collections-generic</artifactId>
      <version>${commons.collections.version}</version>
    </dependency> 
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons.lang.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-io</artifactId>
      <version>1.3.2</version>
    </dependency>
    
    <!-- Scala -->
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-compiler</artifactId>
      <version>${scala.version}</version>
      <scope>test</scope>
    </dependency>        
    
    <!-- test -->
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>javax.servlet</groupId>
          <artifactId>servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.mysema.querydsl</groupId>
      <artifactId>querydsl-core</artifactId>
      <version>${querydsl.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.jsuereth</groupId>
      <artifactId>scala-arm_${scalaArm.scalaVersion}</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>   
            
  </dependencies>
  
  <build>
    <plugins>  
      <plugin>
        <groupId>org.scala-tools</groupId>
        <artifactId>maven-scala-plugin</artifactId>
        <version>2.15.2</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <args>
                <arg>-make:transitivenocp</arg>
                <arg>-dependencyfile</arg>
                <arg>${project.build.directory}/.scala_dependencies</arg>
              </args>
              <jvmArgs>
                <jvmArg>-Xms64m</jvmArg>
                <jvmArg>-Xmx1024m</jvmArg>
              </jvmArgs>
            </configuration>
          </execution>
        </executions>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <projectnatures>
            <projectnature>ch.epfl.lamp.sdt.core.scalanature</projectnature>
            <projectnature>org.eclipse.jdt.core.javanature</projectnature>
          </projectnatures>
          <buildcommands>
            <buildcommand>ch.epfl.lamp.sdt.core.scalabuilder</buildcommand>
          </buildcommands>
          <classpathContainers>
            <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
            <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
          </classpathContainers>
          <excludes>
            <exclude>org.scala-lang:scala-library</exclude>
          </excludes>
          <sourceIncludes>
            <sourceInclude>**/*.scala</sourceInclude>
            <sourceInclude>**/*.java</sourceInclude>
          </sourceIncludes>
        </configuration>
      </plugin>
      
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/main/scala</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/scala</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>    
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>-Xms256m -Xmx512m</argLine>
        </configuration>
      </plugin>      

      <!-- Dependencies needed to run command line jar -->
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
              <execution>
                  <id>copy-dependencies</id>
                  <phase>package</phase>
                  <goals>
                      <goal>copy-dependencies</goal>
                  </goals>
                  <configuration>
                      <includeScope>runtime</includeScope>
                      <overWriteIfNewer>true</overWriteIfNewer>
                      <overWriteSnapshots>true</overWriteSnapshots>
                      <outputDirectory>${basedir}/target/dependencies</outputDirectory>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      
      <plugin>
        <!-- for the test java code in src/test/scala/com/mysema/examples -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  
  <!-- 
  <repositories>
    <repository>
      <id>javaparser</id>
      <url>http://javaparser.googlecode.com/svn/maven2</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>  
   -->
  
</project>
