<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <prerequisites>
    <maven>3.0</maven>
  </prerequisites>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

  <groupId>org.scala-ide</groupId>
  <artifactId>plugin-profiles</artifactId>
  <version>1.0.14</version>
  <name>Scala IDE plugin profiles</name>
  <packaging>pom</packaging>

  <description>
    Inherit this pom file for developing Scala IDE pugins. It contains the right profiles and repositories for developing
    plugins against Scala IDE stable, milestone and nightly versions.
  </description>
  <url>https://github.com/scala-ide/plugin-profiles</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>https://github.com/scala-ide/plugin-profiles</url>
    <connection>scm:git:git://github.com/scala-ide/plugin-profiles.git</connection>
    <developerConnection>scm:git:git@github.com:scala-ide/plugin-profiles.git</developerConnection>
  </scm>
  <developers>
    <developer>
      <id>dragos</id>
      <name>Iulian Dragos</name>
      <url>https://github.com/dragos</url>
    </developer>
    <developer>
      <id>dotta</id>
      <name>Mirco Dotta</name>
      <url>https://github.com/dotta</url>
    </developer>
    <developer>
      <id>skyluc</id>
      <name>Luc Bourlier</name>
      <url>https://github.com/skyluc</url>
    </developer>
  </developers>

  <properties>
    <encoding>UTF-8</encoding>
    <!-- p2 repositories location -->
    <repo.scala-ide.root>http://download.scala-ide.org</repo.scala-ide.root>

    <!-- fixed versions -->
    <tycho.version>0.20.0</tycho.version>
    <scala.plugin.version>3.1.5</scala.plugin.version>

    <!-- tycho test related -->
    <tycho.test.OSspecific />
    <!-- Partial workaround against JDT Weaving deadlocks. See #1000317 and the original ticket on https://issuetracker.springsource.com/browse/STS-1445 -->
    <tycho.test.weaving>-XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -Dosgi.classloader.lock=classname</tycho.test.weaving>
    <tycho.test.jvmArgs>-Xmx800m -XX:MaxPermSize=256m -Dsdtcore.headless ${tycho.test.weaving} ${tycho.test.OSspecific}</tycho.test.jvmArgs>

    <!-- dependencies repos -->
    <eclipse.codename>Specify an Eclipse profile!</eclipse.codename>
    <repo.eclipse>Eclipse Repo missing. Specify an Eclipse profile!</repo.eclipse>
    <repo.ajdt>AJDT Repo missing. Specify an Eclipse profile!</repo.ajdt>
    <weaving.hook.plugin.version>Weaving hook version missing. Specify an Eclipse profile!</weaving.hook.plugin.version>

    <!-- some default values, can be overwritten by profiles -->
    <scala.version>2.12.3</scala.version>
    <version.tag>local</version.tag>
    <repo.scala-ide>Scala IDE repo missing. Specify a Scala IDE profile!</repo.scala-ide> <!-- repository is different for each profile -->

    <!-- dependencies version number -->
    <junit.version>4.10</junit.version>
    <mockito.version>1.9.0</mockito.version>
   </properties>

  <profiles>
    <profile>
      <!-- Scala IDE nightlies no longer support Eclipse Indigo. Hence,
           DO NOT USE `eclipse-indigo` profile if you are building againt Scala IDE master
      -->
      <id>eclipse-indigo</id>
      <properties>
        <eclipse.codename>indigo</eclipse.codename>
        <repo.eclipse>http://download.eclipse.org/releases/indigo/</repo.eclipse>
        <repo.ajdt>http://download.eclipse.org/tools/ajdt/37/update</repo.ajdt>
        <weaving.hook.plugin.version>1.0.200.I20120427-0800</weaving.hook.plugin.version>
        <ecosystem-eclipse-version>e37</ecosystem-eclipse-version>
      </properties>
    </profile>
    <profile>
      <!-- If you are building with the `scala-ide-nightly` profile enabled, make sure to pass this profile (and not `eclipse-indigo`).
           This is needed becasue Scala IDE master moved its sources to support both Eclipse  Juno/Kepler.
           Furthermore, if you build with `eclipse-juno` profile, the produced plug-in will be compatible with both
           Eclipse Juno and Eclipse Kepler.
        -->
      <id>eclipse-juno</id>
      <properties>
        <eclipse.codename>juno</eclipse.codename>
        <repo.eclipse>http://download.eclipse.org/releases/juno/</repo.eclipse>
        <repo.ajdt>http://download.eclipse.org/tools/ajdt/42/update</repo.ajdt>
        <weaving.hook.plugin.version>1.0.200.v20120524-1707</weaving.hook.plugin.version>
        <ecosystem-eclipse-version>e38</ecosystem-eclipse-version>
      </properties>
    </profile>
    <profile>
      <id>eclipse-kepler</id>
      <properties>
        <eclipse.codename>kepler</eclipse.codename>
        <repo.eclipse>http://download.eclipse.org/releases/kepler/</repo.eclipse>
        <repo.ajdt>http://download.eclipse.org/tools/ajdt/43/update</repo.ajdt>
        <weaving.hook.plugin.version>1.0.200.v20130327-1442</weaving.hook.plugin.version>
        <ecosystem-eclipse-version>e38</ecosystem-eclipse-version>
      </properties>
    </profile>
    <profile>
      <id>eclipse-luna</id>
      <properties>
        <eclipse.codename>luna</eclipse.codename>
        <repo.eclipse>http://download.eclipse.org/releases/luna</repo.eclipse>
        <repo.ajdt>http://download.eclipse.org/tools/ajdt/44/dev/update</repo.ajdt>
        <weaving.hook.plugin.version>1.1.100.weaving-hook-20140821</weaving.hook.plugin.version>
        <ecosystem-eclipse-version>e44</ecosystem-eclipse-version>
      </properties>
    </profile>
    <profile>
      <id>eclipse-mars</id>
      <properties>
        <eclipse.codename>mars</eclipse.codename>
        <repo.eclipse>http://download.eclipse.org/releases/mars</repo.eclipse>
        <repo.ajdt>http://download.eclipse.org/tools/ajdt/45/dev/update</repo.ajdt>
        <weaving.hook.plugin.version>1.1.100.v20140821-1915</weaving.hook.plugin.version>
        <ecosystem-eclipse-version>e45</ecosystem-eclipse-version>
      </properties>
    </profile>
    <profile>
      <id>eclipse-neon</id>
      <properties>
        <eclipse.codename>neon</eclipse.codename>
        <repo.eclipse>http://download.eclipse.org/releases/neon</repo.eclipse>
        <repo.ajdt>http://download.eclipse.org/tools/ajdt/46/dev/update</repo.ajdt>
        <weaving.hook.plugin.version>1.1.200.v20150730-1648</weaving.hook.plugin.version>
        <ecosystem-eclipse-version>e46</ecosystem-eclipse-version>
      </properties>
    </profile>
    <profile>
      <id>eclipse-oxygen</id>
      <properties>
        <eclipse.codename>oxygen</eclipse.codename>
        <repo.eclipse>http://download.eclipse.org/releases/oxygen</repo.eclipse>
        <repo.ajdt>http://download.eclipse.org/tools/ajdt/47/dev/update</repo.ajdt>
        <weaving.hook.plugin.version>1.2.0.v20170105-1446</weaving.hook.plugin.version>
        <ecosystem-eclipse-version>e47</ecosystem-eclipse-version>
      </properties>
    </profile>

    <profile>
      <id>scala-2.10.x</id>
      <properties>
        <scala.version>2.10.4</scala.version>
        <version.suffix>2_10</version.suffix>
        <scala.version.short>2.10</scala.version.short>
        <ecosystem-scala-version>210</ecosystem-scala-version>
        <scala-ide-branch>4.0.x</scala-ide-branch>
      </properties>
      <repositories>
        <repository>
          <id>typesafe-ide</id>
          <name>Typesafe IDE repository</name>
          <url>https://proxy-ch.typesafe.com:8082/artifactory/ide-2.10/</url>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>

    <profile>
      <id>scala-2.11.x</id>
      <properties>
        <scala.version>2.11.11</scala.version>
        <version.suffix>2_11</version.suffix>
        <scala.version.short>2.11</scala.version.short>
        <ecosystem-scala-version>211</ecosystem-scala-version>
        <scala-ide-branch>mars</scala-ide-branch>
      </properties>
      <repositories>
        <repository>
          <id>typesafe-ide</id>
          <name>Typesafe IDE repository</name>
          <url>https://proxy-ch.typesafe.com:8082/artifactory/ide-2.11/</url>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>

    <profile>
      <id>scala-2.12.x</id>
      <properties>
        <scala.version>2.12.3</scala.version>
        <version.suffix>2_12</version.suffix>
        <scala.version.short>2.12</scala.version.short>
        <ecosystem-scala-version>212</ecosystem-scala-version>
        <scala-ide-branch>4.0.x</scala-ide-branch>
      </properties>
      <repositories>
        <repository>
          <id>typesafe-ide</id>
          <name>Typesafe IDE repository</name>
          <url>https://proxy-ch.typesafe.com:8082/artifactory/ide-2.12/</url>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>

    <profile>
      <id>scala-ide-nightly</id> <!-- Update site for Scala IDE Nighlties -->
      <properties>
         <repo.scala-ide>${repo.scala-ide.root}/nightly-scala-ide-${scala-ide-branch}-${ecosystem-scala-version}x</repo.scala-ide>
      </properties>
    </profile>

    <profile>
      <id>scala-ide-dev</id> <!-- Update site for Scala IDE Milestones and RCs releases -->
      <properties>
        <repo.scala-ide>${repo.scala-ide.root}/sdk/lithium/${ecosystem-eclipse-version}/scala${ecosystem-scala-version}/dev/site</repo.scala-ide>
      </properties>
    </profile>

    <profile>
      <id>scala-ide-stable</id> <!-- Update site for Scala IDE Stable/Final releases -->
      <properties>
        <repo.scala-ide>${repo.scala-ide.root}/sdk/lithium/${ecosystem-eclipse-version}/scala${ecosystem-scala-version}/stable/site</repo.scala-ide>
      </properties>
    </profile>

    <profile>
      <!-- some configuration for tests run by tycho on Mac OS -->
      <id>macOs</id>
      <activation>
        <os>
          <family>mac</family>
        </os>
      </activation>
      <properties>
        <tycho.test.OSspecific>-Dosgi.ws=cocoa -XstartOnFirstThread</tycho.test.OSspecific>
      </properties>
       <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.eclipse.tycho</groupId>
              <artifactId>tycho-surefire-plugin</artifactId>
              <configuration>
                <dependencies>
                  <dependency>
                    <artifactId>org.eclipse.jdt.launching.macosx</artifactId>
                    <type>eclipse-plugin</type>
                  </dependency>
                </dependencies>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
<!-- jar signing -->
    <profile>
        <id>sign</id>
        <activation>
            <property>
                <name>jarsigner.keystore</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jarsigner-plugin</artifactId>
                    <version>1.2</version>
                    <executions>
                        <execution>
                            <id>sign</id>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                      <alias>typesafe</alias>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
    <profile>
      <!-- pull the data needed to add the version numbers to the manifests -->
      <id>set-versions</id>
      <dependencies>
        <dependency>
          <groupId>org.scala-ide</groupId>
          <artifactId>build-tools_2.11</artifactId>
          <version>0.5.2</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
              <execution>
                <id>copy.reflect</id>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <classpathScope>compile</classpathScope>
              <mainClass>org.scalaide.buildtools.UpdateAddonManifests</mainClass>
              <arguments>
                <argument>${repo.scala-ide}</argument>
              </arguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <repositories>
        <repository>
          <!-- extra repository containing the build package -->
          <id>typesafe-ide</id>
          <name>Typesafe IDE repository</name>
          <url>https://proxy-ch.typesafe.com:8082/artifactory/ide-2.11/</url>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-all</artifactId>
        <version>${mockito.version}</version>
        <scope>compile</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <repositories>
    <repository>
      <id>sonatype.release</id>
      <name>Sonatype maven release repository</name>
      <url>https://oss.sonatype.org/content/repositories/releases/</url>
      <snapshots><enabled>false</enabled></snapshots>
    </repository>
    <repository>
      <id>sonatype.snapshot</id>
      <name>Sonatype maven snapshot repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <snapshots>
        <updatePolicy>daily</updatePolicy>
      </snapshots>
    </repository>
    <repository>
      <id>scala-ide</id>
      <name>Scala IDE p2 repository</name>
      <layout>p2</layout>
      <url>${repo.scala-ide}</url>
      <snapshots><enabled>false</enabled></snapshots>
    </repository>
    <repository>
      <id>eclipse.${eclipse.codename}</id>
      <name>Eclipse p2 repository</name>
      <layout>p2</layout>
      <url>${repo.eclipse}</url>
      <snapshots><enabled>false</enabled></snapshots>
    </repository>
    <repository>
      <id>ajdt.${eclipse.codename}</id>
      <name>AJDT for Eclipse p2 repository</name>
      <layout>p2</layout>
      <url>${repo.ajdt}</url>
      <snapshots><enabled>false</enabled></snapshots>
    </repository>
  </repositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-surefire-plugin</artifactId>
          <version>${tycho.version}</version>
          <configuration>
            <useUIHarness>false</useUIHarness>
            <useUIThread>false</useUIThread>

            <!-- Enable JDT weaving -->
            <systemProperties combine.children="append">
              <aj.weaving.verbose>true</aj.weaving.verbose>
              <org.aspectj.weaver.showWeaveInfo>true</org.aspectj.weaver.showWeaveInfo>
              <org.aspectj.osgi.verbose>true</org.aspectj.osgi.verbose>
            </systemProperties>
            <frameworkExtensions>
              <frameworkExtension>
                <groupId>p2.osgi.bundle</groupId>
                <artifactId>org.eclipse.equinox.weaving.hook</artifactId>
                <version>${weaving.hook.plugin.version}</version>
              </frameworkExtension>
            </frameworkExtensions>
            <bundleStartLevel>
              <bundle>
                <id>org.eclipse.equinox.weaving.aspectj</id>
                <level>2</level>
                <autoStart>true</autoStart>
              </bundle>
            </bundleStartLevel>
            <argLine>${tycho.test.jvmArgs}</argLine>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-maven-plugin</artifactId>
        <version>${tycho.version}</version>
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-compiler-plugin</artifactId>
        <version>${tycho.version}</version>
        <configuration>
          <excludeResources>
            <excludeResource>**/*.scala</excludeResource>
          </excludeResources>
        </configuration>
      </plugin>
      <plugin>
        <!-- configuration of the scala compiler -->
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>${scala.plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <jvmArgs>
            <jvmArg>-Xms512m</jvmArg>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-source-plugin</artifactId>
        <version>${tycho.version}</version>
        <executions>
          <execution>
            <id>attach-source</id>
            <goals>
              <goal>plugin-source</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- for setting a better qualifier -->
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-packaging-plugin</artifactId>
        <version>${tycho.version}</version>
        <configuration>
          <format>'${version.tag}-${version.suffix}-'yyyyMMddHHmm'-${buildNumber}'</format>
          <archiveSite>true</archiveSite>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-versions-plugin</artifactId>
        <version>${tycho.version}</version>
      </plugin>
      <!-- plugin used to extract the git hash-->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <shortRevisionLength>7</shortRevisionLength>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
