<?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>

	<groupId>org.eclipse.app4mc.build</groupId>
	<artifactId>parent</artifactId>
	<version>2.0.0</version>

	<packaging>pom</packaging>

	<name>APP4MC Tool Platform</name>
	<description>APP4MC Tool Platform for editing AMALTHEA models</description>
	<url>https://projects.eclipse.org/projects/automotive.app4mc</url>
    
    <licenses>
        <license>
            <name>Eclipse Public License - v 2.0</name>
            <url>https://www.eclipse.org/legal/epl-2.0/</url>
        </license>
    </licenses>

	<developers>
    	<developer>
			<name>Harald Mackamul</name>
			<email>harald.mackamul@de.bosch.com</email>
		</developer>
    	<developer>
			<name>Dirk Fauth</name>
			<email>dirk.fauth@de.bosch.com</email>
		</developer>
    	<developer>
			<name>Zakir Hussain Meer</name>
			<email>ZakirHussain.Meer@de.bosch.com</email>
		</developer>
    	<developer>
			<name>Sebastian Reiser</name>
			<email>sebastian.reiser@de.bosch.com</email>
		</developer>
    	<developer>
			<name>Lukas Krawczyk</name>
			<email>lukas.krawczyk@fh-dortmund.de</email>
		</developer>
	</developers>
  
    <scm>
        <connection>scm:git:git://git.eclipse.org/gitroot/app4mc/org.eclipse.app4mc.git</connection>
        <developerConnection>scm:git:https://git.eclipse.org/r/app4mc/org.eclipse.app4mc.git</developerConnection>
        <url>https://git.eclipse.org/c/app4mc/org.eclipse.app4mc.git</url>
    </scm>

	<properties>
		<app4mc.version>2.0.0</app4mc.version>
		<app4mc.baseline>1.2.0</app4mc.baseline>

		<!-- must be same version as in ./.mvn/extensions.xml -->
		<tycho.version>2.0.0</tycho.version>
		<tycho-extras-version>2.0.0</tycho-extras-version>

		<jarsigner-version>1.3.1</jarsigner-version>

		<build-helper.version>1.9.1</build-helper.version>
		<org.jboss.tools.tycho-plugins.version>1.4.0</org.jboss.tools.tycho-plugins.version>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<maven.build.timestamp.format>yyyyMMdd-HHmmss</maven.build.timestamp.format>

		<jacoco.version>0.8.5</jacoco.version>
		<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../../releng/org.eclipse.app4mc.p2repo/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
		<sonar.surefire.reportsPath>../../tests/${project.artifactId}.tests/target/surefire-reports/</sonar.surefire.reportsPath>
		<sonar.exclusions>**/src-gen/**/*,**/xtend-gen/**/*,**/xcore-gen/**/*</sonar.exclusions>
		<sonar.issue.ignore.allfile>generated</sonar.issue.ignore.allfile>
		<sonar.issue.ignore.allfile.generated.fileRegexp>@generated</sonar.issue.ignore.allfile.generated.fileRegexp>
		<sonar.java.source>8</sonar.java.source>
		<!-- coverage exclusions -->
		<sonar.coverage.exclusions>**/*.tests/**/*.java</sonar.coverage.exclusions>
		<!-- duplication exclusion -->
		<sonar.cpd.exclusions>**/*.tests/**/*.java</sonar.cpd.exclusions>
	</properties>
	
	<pluginRepositories>

		<pluginRepository>
			<id>jboss-public-repository-group</id>
			<name>JBoss Public Repository Group</name>
			<url>https://repository.jboss.org/nexus/content/groups/public/</url>
		</pluginRepository>

		<pluginRepository>
			<id>jboss-snapshots-repository</id>
			<name>JBoss Snapshots Repository</name>
			<url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
		</pluginRepository>

		<pluginRepository>
			<id>cbi</id>
			<url>https://repo.eclipse.org/content/repositories/cbi-releases/</url>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
        </pluginRepository>
		<pluginRepository>
			<id>cbi-snapshots</id>
			<url>https://repo.eclipse.org/content/repositories/cbi-snapshots/</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>
	
	  

	<!-- Common plugins and features contained in the open source distribution -->
	<modules>

		<!-- Examples first ! (will be used by installers) -->
		<module>examples/app4mc.example.democar</module>
		<module>examples/app4mc.example.democar.extended</module>
		<module>examples/app4mc.example.democar.split</module>
		<module>examples/app4mc.example.hardware</module>
		<module>examples/app4mc.example.scheduler</module>
		<module>examples/app4mc.example.numeric_modes</module>
		<module>examples/app4mc.example.modeling</module>
		<module>examples/app4mc.example.modeling.client_server</module>
		<module>examples/app4mc.example.modeling.feedback_loop</module>
		<module>examples/app4mc.example.modeling.periodic</module>
		<module>examples/app4mc.example.modeling.state_machine</module>
		<module>examples/app4mc.example.modeling.state_machine_feedback_loop</module>
		<module>examples/app4mc.example.tool.java</module>
		<module>examples/app4mc.example.tool.validation</module>
		<module>examples/app4mc.example.tool.workflow</module>
		<module>examples/waters.fmtv.challenge.2016</module>
		<module>examples/waters.fmtv.challenge.2017</module>
		<module>examples/waters.fmtv.challenge.2019</module>

		<module>plugins</module>
		<module>tests</module>
		<module>features</module>
		<module>releng</module>
		
	</modules>

	
	<build>
		<pluginManagement>
			<plugins>
				<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.version}</version>
						</dependency>
					</dependencies>

					<configuration>
						<timestampProvider>jgit</timestampProvider>
						<jgit.ignore>pom.xml</jgit.ignore>
						<jgit.dirtyWorkingTree>ignore</jgit.dirtyWorkingTree>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-p2-plugin</artifactId>
					<version>${tycho.version}</version>

					<configuration>
						<baselineReplace>none</baselineReplace>
						<baselineRepositories>
							<repository>
								<url>https://download.eclipse.org/app4mc/updatesites/releases/${app4mc.baseline}/</url>
							</repository>
						</baselineRepositories>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-compiler-plugin</artifactId>
					<version>${tycho.version}</version>
<!--					
					<configuration>
						<useProjectSettings>false</useProjectSettings>
						<encoding>UTF-8</encoding>
						<extraClasspathElements>
							<extraClasspathElement>
								<groupId>com.oracle</groupId>
								<artifactId>javafx</artifactId>
								<version>8.0.0-SNAPSHOT</version>
								<systemPath>${java.home}/lib/jfxswt.jar</systemPath>
								<scope>system</scope>
							</extraClasspathElement>
						</extraClasspathElements>
					</configuration>
-->					
					<configuration>
						<useProjectSettings>false</useProjectSettings>
						<encoding>UTF-8</encoding>
						<extraClasspathElements>
						  <extraClasspathElement>
							<groupId>org.openjfx</groupId>
							<artifactId>javafx-controls</artifactId>
							<version>11.0.2</version>
						  </extraClasspathElement>
						  <extraClasspathElement>
							<groupId>org.openjfx</groupId>
							<artifactId>javafx-web</artifactId>
							<version>11.0.2</version>
						  </extraClasspathElement>
						  <extraClasspathElement>
							<groupId>org.openjfx</groupId>
							<artifactId>javafx-swt</artifactId>
							<version>11.0.2</version>
							<systemPath>${project.basedir}/../../releng/lib/javafx-sdk-11.0.2/javafx-swt.jar</systemPath>
							<scope>system</scope>
						  </extraClasspathElement>
						</extraClasspathElements>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco.version}</version>
				</plugin>
				<plugin> 
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</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-source-plugin</artifactId>
				<version>${tycho.version}</version>

				<executions>
					<execution>
						<id>plugin-source</id>
						<goals>
							<goal>plugin-source</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-surefire-plugin</artifactId>
				<version>${tycho.version}</version>

				<configuration>
					<includes>
						<forkMode>never</forkMode>
						<include>**/*Test.java</include>
						<include>**/*Tests.java</include>
					</includes>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho.version}</version>

				<configuration>
					<includePackedArtifacts>true</includePackedArtifacts>
					<environments>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>macosx</os>
							<ws>cocoa</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
					<target>
						<artifact>
							<groupId>org.eclipse.app4mc.build</groupId>
							<artifactId>org.eclipse.app4mc.target</artifactId>
							<version>${app4mc.version}</version>
						</artifact>
					</target>
					<targetDefinitionIncludeSource>honor</targetDefinitionIncludeSource>
				</configuration>
			</plugin>
			
			<!--
			<plugin>
				<groupId>org.eclipse.tycho.extras</groupId>
				<artifactId>tycho-eclipserun-plugin</artifactId>
				<version>${tycho-extras-version}</version>
				<configuration>
					<repositories>
						<repository>
							<id>${platform-version-name}</id>
							<layout>p2</layout>
							<url>http://download.eclipse.org/releases/${platform-version-name}</url>
						</repository>
						<repository>
							<id>targetplatform</id>
							<layout>p2</layout>
							<url>${targetPlatform.repository.p2}</url>
						</repository>
					</repositories>
					<appArgLine>-consoleLog -application ${targetPlatform.application.name} ${targetPlatform.application.args}</appArgLine>
					<dependencies>
						<dependency>
							<artifactId>${targetPlatform.application.feature}</artifactId>
							<type>eclipse-feature</type>
						</dependency>
						<dependency>
							<artifactId>org.eclipse.equinox.p2.sdk</artifactId>
							<type>eclipse-feature</type>
						</dependency>
					</dependencies>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>eclipse-run</goal>
						</goals>
						<phase>validate</phase>
					</execution>
				</executions>
			</plugin>
			-->

		</plugins>
	</build>
	
	<profiles>
		<profile>
			<id>sonar</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>

						<configuration>
							<sessionId>${project.artifactId}</sessionId>
						</configuration>

						<executions>
							<execution>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<profile>
			<id>sign</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.eclipse.tycho.extras</groupId>
						<artifactId>tycho-pack200a-plugin</artifactId>
						<version>${tycho-extras-version}</version>
						<executions>
							<execution>
								<id>pack200-normalize</id>
								<goals>
									<goal>normalize</goal>
								</goals>
								<phase>package</phase>
							</execution>
						</executions>
					</plugin>
					
					<plugin>
						<groupId>org.eclipse.cbi.maven.plugins</groupId>
						<artifactId>eclipse-jarsigner-plugin</artifactId>
						<version>${jarsigner-version}</version>
						<executions>
							<execution>
								<id>sign</id>
								<phase>package</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					
					<plugin>
						<groupId>org.eclipse.tycho.extras</groupId>
						<artifactId>tycho-pack200b-plugin</artifactId>
						<version>${tycho-extras-version}</version>
						<executions>
							<execution>
								<id>pack200-pack</id>
								<goals>
									<goal>pack</goal>
								</goals>
								<phase>package</phase>
							</execution>
						</executions>
					</plugin>
					
					<!-- Then, alter p2-metadata to make the .pack.gz artifact visible from other modules -->
					<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>package</phase>
							</execution>
						</executions>
						<configuration>
							<defaultP2Metadata>false</defaultP2Metadata>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		
        <profile>
          <id>skip-deploy</id>
          <activation>
            <file>
              <missing>pom.xml</missing>
            </file>
          </activation>
          <properties>
            <maven.deploy.skip>true</maven.deploy.skip>
          </properties>
        </profile>

		<profile>
		  <id>maven-publish</id>
		 
		  <distributionManagement>
		    <snapshotRepository>
		      <id>ossrh</id>
		      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
		    </snapshotRepository>
		    <repository>
		      <id>ossrh</id>
		      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		    </repository>
		  </distributionManagement>
		 
		  <build>
		    <plugins>
		      <plugin>
		        <groupId>org.apache.maven.plugins</groupId>
		        <artifactId>maven-gpg-plugin</artifactId>
		        <version>1.6</version>
		        <executions>
		          <execution>
		            <id>sign-artifacts</id>
		            <phase>verify</phase>
		            <goals>
		              <goal>sign</goal>
		            </goals>
		            <configuration>
		              <gpgArguments>
		                <arg>--pinentry-mode</arg>
		                <arg>loopback</arg>
		              </gpgArguments>
		            </configuration>
		          </execution>
		        </executions>
		      </plugin>
		    </plugins>
		  </build>
		</profile>
	</profiles>
 </project>