<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright (c) 2012, 2018 Eclipse Foundation and others.
  All rights reserved. This program and the accompanying materials
  are made available under the terms of the Eclipse Distribution License v1.0
  which accompanies this distribution, and is available at
  http://www.eclipse.org/org/documents/edl-v10.php
 
  Contributors:
    Thanh Ha (Eclipse Foundation) - initial implementation
    Mickael Istria (Red Hat Inc.) - 424087 distributionManagement to enable mvn deploy
    Nick Boldt (Red Hat Inc.) - support for Tycho 1.1 and upstream component builds
-->

<project
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.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>org.eclipse</groupId>
  <artifactId>wtp-parent</artifactId>
  <version>3.10.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <properties>
    <tycho.version>1.3.0</tycho.version>
    <tycho-extras.version>${tycho.version}</tycho-extras.version>
    <tycho-repo.url>https://oss.sonatype.org/content/repositories/public/</tycho-repo.url>
    <tycho-snapshot-repo.url>https://repo.eclipse.org/content/repositories/tycho-snapshots/</tycho-snapshot-repo.url>

    <cbi-plugins.version>1.1.4</cbi-plugins.version>
    <cbi-repo.url>https://repo.eclipse.org/content/repositories/cbi/</cbi-repo.url>
    <!-- switch to use  ${cbi-repo.url}
    <cbi-snapshot-repo.url>https://repo.eclipse.org/content/repositories/cbi-snapshots/</cbi-snapshot-repo.url>
    -->
    <!-- baseline comparator
         NOTE: while there are WTP projects in Oxygen.x releases that are build from master (eg., JSF. JSDT, Dali), 
         we cannot use an Oxygen baseline for all the builds, so stick with Neon for now -->
    <comparator.repo>http://download.eclipse.org/webtools/repository/neon/</comparator.repo>

    <!-- dependency repos -->
    <!-- <license-repo.url>http://download.eclipse.org/cbi/updates/license/1.0.1.v20140414-1359/</license-repo.url> -->
    <!-- <license-repo.url>http://download.eclipse.org/cbi/updates/license/2.0.0.v20180130-0820/</license-repo.url> -->
    <license-repo.url>http://download.eclipse.org/cbi/updates/license/</license-repo.url>

    <!-- this folder is a composite of the last 5 builds; you might want to override to build against a single specific subfolder -->
    <platform-repo.url>http://download.eclipse.org/eclipse/updates/I-builds/</platform-repo.url>
    <!-- <platform-repo.url>http://download.eclipse.org/eclipse/updates/4.12-I-builds/</platform-repo.url> -->
    <!-- <platform-repo.url>https://download.eclipse.org/eclipse/updates/milestones</platform-repo.url> -->
    <!-- <platform-repo.url>http://download.eclipse.org/eclipse/updates/4.8milestones/S-4.8RC4-201806071630/</platform-repo.url> -->

    <!-- NOTE: sometimes an S build is newer than its closest I build so it's worth checking this from time to time -->
    <orbit-repo.url>http://download.eclipse.org/tools/orbit/downloads/latest-I/</orbit-repo.url>
    <!-- <orbit-repo.url>https://download.eclipse.org/tools/orbit/downloads/drops/R20190226160451/repository/</orbit-repo.url> -->
    <jetty-repo.url>http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.18.v20190429/</jetty-repo.url>
    <!--  TODO: <jetty-repo.url>http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.19.v20190610/</jetty-repo.url> -->
    <graphiti-repo.url>http://download.eclipse.org/graphiti/updates/0.16.0/</graphiti-repo.url>
    <dtp-repo.url>http://download.eclipse.org/datatools/updates/1.14.105-SNAPSHOT/repository/</dtp-repo.url>

    <!-- <jgit-repo.url>http://download.eclipse.org/egit/updates-4.9/</jgit-repo.url> -->
    <jgit-repo.url>http://download.eclipse.org/egit/updates/</jgit-repo.url>

    <!-- EMF 2.16 M3 20181120 milestone -->
    <emf-repo.url>http://download.eclipse.org/modeling/emf/emf/builds/milestone/latest/</emf-repo.url>
    <emf-transaction-repo.url>http://download.eclipse.org/modeling/emf/transaction/updates/releases/R201706061339/</emf-transaction-repo.url>
    <emf-validation-repo.url>http://download.eclipse.org/modeling/emf/validation/updates/releases/R201812070911/</emf-validation-repo.url>
    <!-- NOTE: EclipseLink 2.7.4 does not include org.eclipse.persistence.moxy, on which org.eclipse.jpt.jaxb.eclipselink.feature.feature.group depends -->
    <!-- TODO when https://bugs.eclipse.org/bugs/show_bug.cgi?id=545221 is fixed and a new EclipseLink release is available, switch to 2.7.5.
    <eclipselink-repo.url>https://download.eclipse.org/rt/eclipselink/nightly-updates/2.7.5.v20190516-fee9a44e1d/</eclipselink-repo.url> 
    -->
    <eclipselink-repo.url>http://download.eclipse.org/rt/eclipselink/updates/2.7.3.v20180807-4be1041</eclipselink-repo.url>
    <swtbot-repo.url>http://download.eclipse.org/technology/swtbot/releases/2.7.0/</swtbot-repo.url>

    <gef-repo.url>https://ci.eclipse.org/gef/job/gef-master/lastStableBuild/artifact/update-site/</gef-repo.url>
    <gef-legacy-repo.url>http://download.eclipse.org/tools/gef/updates/legacy/integration/5.0.0_gef-legacy-master_2166/</gef-legacy-repo.url>

   <!-- CI builds of various WTP components, to be used in components' root poms that depend on them -->
    <webtools-CI-site-prefix>https://ci.eclipse.org/webtools/job/webtools-</webtools-CI-site-prefix>
    <webtools-CI-site-suffix>_master/lastSuccessfulBuild/artifact/site/target/repository/</webtools-CI-site-suffix>
    <webtools-CI-integration-site-suffix>_master/lastSuccessfulBuild/artifact/site-integration/target/repository/</webtools-CI-integration-site-suffix>
    
    <webtools-common-site>${webtools-CI-site-prefix}common${webtools-CI-site-suffix}</webtools-common-site>
    <webtools-servertools-site>${webtools-CI-site-prefix}servertools${webtools-CI-site-suffix}</webtools-servertools-site>
    <webtools-servertools-integration-site>${webtools-CI-site-prefix}servertools-integration${webtools-CI-integration-site-suffix}</webtools-servertools-integration-site>
    <webtools-jsdt-site>${webtools-CI-site-prefix}jsdt${webtools-CI-site-suffix}</webtools-jsdt-site>
    <webtools-sourceediting-site>${webtools-CI-site-prefix}sourceediting${webtools-CI-site-suffix}</webtools-sourceediting-site>

    <webtools-jeetools-site>${webtools-CI-site-prefix}javaee${webtools-CI-site-suffix}</webtools-jeetools-site>
    <webtools-dali-site>${webtools-CI-site-prefix}dali${webtools-CI-site-suffix}</webtools-dali-site>
    <webtools-jsf-site>${webtools-CI-site-prefix}jsf${webtools-CI-site-suffix}</webtools-jsf-site> 
    <webtools-webservices-site>${webtools-CI-site-prefix}webservices${webtools-CI-site-suffix}</webtools-webservices-site>

    <!-- for use when building individual plugins or running integration tests which have cross-module deps -->
    <!-- By default use latest WTP integration build, but can be overriden in CLI
         mvn clean verify -Pbuild-individual-bundles -Dwebtools.buildSite=http://....
    -->
    <!-- since /I-latest/ still hasn't been created, point at an ACTUAL valid folder so we can actually build w/o hacks -->
    <!-- <webtools.buildSite>http://download.eclipse.org/webtools/downloads/drops/R3.12.0/I-3.12.0-20181004000115/</webtools.buildSite> -->
    <webtools.buildSite>http://download.eclipse.org/webtools/downloads/drops/R3.14.0/I-latest/</webtools.buildSite>
    <webtools.repository>${webtools.buildSite}/repository</webtools.repository>
    <webtools.testsRepository>${webtools.buildSite}/repositoryunittests</webtools.testsRepository>

    <!-- if you have integration tests, you can skip them using this -->
    <skipITests>true</skipITests>

  </properties>

  <repositories>
    <repository>
      <id>license-feature</id>
      <url>${license-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>platform</id>
      <url>${platform-repo.url}</url>
      <layout>p2</layout>
    </repository>
    
    <repository>
      <id>emf</id>
      <url>${emf-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>emf-transaction</id>
      <url>${emf-transaction-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>emf-validation</id>
      <url>${emf-validation-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>gef</id>
      <url>${gef-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>gef-legacy</id>
      <url>${gef-legacy-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>dtp</id>
      <url>${dtp-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>graphiti</id>
      <url>${graphiti-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>orbit</id>
      <url>${orbit-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>eclipselink</id>
      <url>${eclipselink-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>jetty</id>
      <url>${jetty-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>jgit</id>
      <url>${jgit-repo.url}</url>
      <layout>p2</layout>
    </repository>
    <repository>
      <id>swtbot</id>
      <url>${swtbot-repo.url}</url>
      <layout>p2</layout>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>tycho</id>
      <url>${tycho-repo.url}</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>cbi-repo</id>
      <url>${cbi-repo.url}</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>tycho-snapshot</id>
      <url>${tycho-snapshot-repo.url}</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
    <!-- switch to use  ${cbi-repo.url}
    <pluginRepository>
      <id>cbi-snapshot-repo</id>
      <url>${cbi-snapshot-repo.url}</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
    -->
    <pluginRepository>
      <id>sonatype-public-grid</id>
      <url>https://repository.sonatype.org/content/groups/sonatype-public-grid</url>
    </pluginRepository>
    <pluginRepository>
      <id>sonatype-public-repository</id>
      <url>https://oss.sonatype.org/content/groups/public</url>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-maven-plugin</artifactId>
        <version>${tycho.version}</version>
        <extensions>true</extensions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>regex-property</id>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
              <name>skipTestsOrITests</name>
              <value>${skipTests}${skipITests}</value>
              <regex>((..skipTests.)?(true)?((..skipITests.)|(null)|(true)|(false))?)</regex>
              <replacement>$3</replacement>
              <failIfNoMatch>false</failIfNoMatch>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <configuration>
          <environments>
            <environment>
              <os>linux</os>
              <ws>gtk</ws>
              <arch>x86_64</arch>
            </environment>
            <environment>
              <os>win32</os>
              <ws>win32</ws>
              <arch>x86_64</arch>
            </environment>
            <environment>
              <os>macosx</os>
              <ws>cocoa</ws>
              <arch>x86_64</arch>
            </environment>
          </environments>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-source-plugin</artifactId>
        <executions>
          <execution>
            <id>plugin-source</id>
            <goals>
              <goal>plugin-source</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>target-platform-configuration</artifactId>
          <version>${tycho.version}</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-compiler-plugin</artifactId>
          <version>${tycho.version}</version>
          <configuration>
            <compilerArgument>-warn:+discouraged,forbidden</compilerArgument>
            <!-- ignore project settings which appear in Eclipse but are ignored by Tycho <= 0.26, like API access restrictions -->
            <useProjectSettings>false</useProjectSettings>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-packaging-plugin</artifactId>
          <version>${tycho.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.eclipse.tycho.extras</groupId>
              <artifactId>tycho-buildtimestamp-jgit</artifactId>
              <version>${tycho-extras.version}</version>
            </dependency>
            <dependency>
              <groupId>org.eclipse.tycho.extras</groupId>
              <artifactId>tycho-sourceref-jgit</artifactId>
              <version>${tycho-extras.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <strictBinIncludes>false</strictBinIncludes>
            <format>'v'yyyyMMddHHmm</format>
            <timestampProvider>jgit</timestampProvider>
            <jgit.ignore>
              pom.xml
            </jgit.ignore>

            <!--
                Valid options: error, warning, and ignore
                jgit.dirtyWorkingTree checking was added as of Tycho 0.19.0
                see: https://bugs.eclipse.org/419030
            -->
            <jgit.dirtyWorkingTree>ignore</jgit.dirtyWorkingTree>
            <sourceReferences>
              <generate>true</generate>
            </sourceReferences>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-surefire-plugin</artifactId>
          <version>${tycho.version}</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-source-plugin</artifactId>
          <version>${tycho.version}</version>
          <configuration>
            <strictSrcIncludes>false</strictSrcIncludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-p2-director-plugin</artifactId>
          <version>${tycho.version}</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-p2-repository-plugin</artifactId>
          <version>${tycho.version}</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho.extras</groupId>
          <artifactId>tycho-source-feature-plugin</artifactId>
          <version>${tycho-extras.version}</version>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho</groupId>
          <artifactId>tycho-p2-plugin</artifactId>
          <version>${tycho.version}</version>
          <!-- not ready for this yet; causes dali to fail in hudson <executions>
            <execution>
              <id>attached-p2-metadata</id>
              <phase>package</phase>
              <goals>
                <goal>p2-metadata</goal>
              </goals>
            </execution>
          </executions> -->
          <configuration>
            <baselineMode>warn</baselineMode>
            <baselineReplace>all</baselineReplace>
            <baselineRepositories>
              <repository>
                <url>${comparator.repo}</url>
              </repository>
            </baselineRepositories>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.eclipse.tycho.extras</groupId>
          <artifactId>tycho-custom-bundle-plugin</artifactId>
          <version>${tycho-extras.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>macosx</id>
      <activation>
        <os>
          <family>mac</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-surefire-plugin</artifactId>
            <version>${tycho.version}</version>
            <configuration>
              <argLine>-XX:MaxPermSize=128m -XstartOnFirstThread</argLine>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>bree-libs</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.eclipse.tycho</groupId>
              <artifactId>tycho-compiler-plugin</artifactId>
              <version>${tycho.version}</version>
              <configuration>
                <!--
                  this tells Tycho to use JRE libraries that match bundle runtime execution environment
                  http://wiki.eclipse.org/Tycho/Release_Notes/0.14
                  TODO provide CBI-specific wiki that explains how to setup BREE libraries and toolchain.xml
                -->
                <useJDK>BREE</useJDK>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
    <profile>
      <id>eclipse-sign</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho.version}</version>
            <configuration>
              <includePackedArtifacts>true</includePackedArtifacts>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.eclipse.tycho.extras</groupId>
            <artifactId>tycho-pack200a-plugin</artifactId>
            <version>${tycho-extras.version}</version>
            <configuration>
              <fork>false</fork>
            </configuration>
            <executions>
              <execution>
                <id>pack200-normalize</id>
                <goals>
                  <goal>normalize</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.eclipse.cbi.maven.plugins</groupId>
            <artifactId>eclipse-jarsigner-plugin</artifactId>
            <version>${cbi-plugins.version}</version>
            <executions>
              <execution>
                <id>sign</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.eclipse.tycho.extras</groupId>
            <artifactId>tycho-pack200b-plugin</artifactId>
            <version>${tycho-extras.version}</version>
            <configuration>
              <fork>false</fork>
            </configuration>
            <executions>
              <execution>
                <id>pack200-pack</id>
                <goals>
                  <goal>pack</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-p2-plugin</artifactId>
            <version>${tycho.version}</version>
            <executions>
              <execution>
                <id>p2-metadata</id>
                <goals>
                  <goal>p2-metadata</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
            <configuration>
              <defaultP2Metadata>false</defaultP2Metadata>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- DEPRECATED: profile used to build an individual plugin or project, if it depends on another upstream or downstream wtp project (which has not already been built locally) -->
    <profile>
      <id>build-individual-bundles</id>
      <activation>
        <property>
          <name>skipITests</name>
          <value>false</value>
        </property>
      </activation>
      <repositories>
        <repository>
          <id>webtools-repo</id>
          <url>${webtools.repository}</url>
          <layout>p2</layout>
        </repository>
        <repository>
          <id>webtools-tests-repo</id>
          <url>${webtools.testsRepository}</url>
          <layout>p2</layout>
        </repository>
      </repositories>
    </profile>
    <!-- profile used to run integration tests, which might depend on plugins from another upstream or downstream wtp project
         can also be used as a replacement for -Pbuild-individual-bundles profile since it basically does the same thing
    -->
    <profile>
      <id>integration</id>
      <properties>
        <skipITests>false</skipITests>
      </properties>
      <repositories>
        <repository>
          <id>webtools-repo</id>
          <url>${webtools.repository}</url>
          <layout>p2</layout>
        </repository>
        <repository>
          <id>webtools-tests-repo</id>
          <url>${webtools.testsRepository}</url>
          <layout>p2</layout>
        </repository>
      </repositories>
    </profile>

    <profile>
      <id>CI</id>
      <repositories>
        <repository>
          <id>webtools-common-site</id>
          <layout>p2</layout>
          <url>${webtools-common-site}</url>
        </repository>
        <repository>
          <id>webtools-servertools-site</id>
          <layout>p2</layout>
          <url>${webtools-servertools-site}</url>
        </repository>
        <repository>
          <id>webtools-servertools-integration-site</id>
          <layout>p2</layout>
          <url>${webtools-servertools-integration-site}</url>
        </repository>
        <repository>
          <id>webtools-jsdt-site</id>
          <layout>p2</layout>
          <url>${webtools-jsdt-site}</url>
        </repository>
        <repository>
          <id>webtools-sourceediting-site</id>
          <layout>p2</layout>
          <url>${webtools-sourceediting-site}</url>
        </repository>

        <repository>
          <id>webtools-jeetools-site</id>
          <layout>p2</layout>
          <url>${webtools-jeetools-site}</url>
        </repository>
        <repository>
          <id>webtools-dali-site</id>
          <layout>p2</layout>
          <url>${webtools-dali-site}</url>
        </repository>
        <repository>
          <id>webtools-jsf-site</id>
          <layout>p2</layout>
          <url>${webtools-jsf-site}</url>
        </repository>
        <repository>
          <id>webtools-webservices-site</id>
          <layout>p2</layout>
          <url>${webtools-webservices-site}</url>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <distributionManagement>
    <repository>
      <id>repo.eclipse.org</id>
      <name>Webtools Repository - Releases</name>
      <url>https://repo.eclipse.org/content/repositories/webtools-releases/</url>
    </repository>
    <snapshotRepository>
      <id>repo.eclipse.org</id>
      <name>Webtools Repository - Snapshots</name>
      <url>https://repo.eclipse.org/content/repositories/webtools-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
</project>

