<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>hu.blackbelt.epsilon</groupId>
    <artifactId>hu.blackbelt.epsilon.runtime</artifactId>
	<packaging>pom</packaging>
    <version>1.2.2</version>

	<name>Epsilon :: Runtime :: Eclipse</name>

	<description>Epsilon runtime Parent</description>

	<url>http://github.com/${project-repositoryId}</url>

	<issueManagement>
		<url>https://github.com/${project-repositoryId}/issues</url>
		<system>GitHub Issues</system>
	</issueManagement>

	<scm>
		<connection>scm:git:git@github.com:${project-repositoryId}.git</connection>
		<developerConnection>scm:git:ssh://${git.username}@github.com:${project-repositoryId}.git
        </developerConnection>
		<url>http://github.com/${project-repositoryId}</url>
	</scm>

    <developers>
        <developer>
            <id>robson</id>
            <name>Róbert Csákány</name>
            <email>robert.csakany@blackbelt.hu</email>
            <url>https://github.com/robertcsakany</url>
            <organization>BlackBelt Technology</organization>
            <organizationUrl>http://www.blackbelt.hu</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://opensource.org/licenses/Apache-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

	<properties>
        <project-shortname>epsilon-runtime-eclipse</project-shortname>
        <project-repositoryId>BlackBeltTechnology/epsilon-runtime-eclipse</project-repositoryId>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<timestamp>${maven.build.timestamp}</timestamp>
		<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>

		<epsilon-runtime-version>1.2.2</epsilon-runtime-version>

		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<tycho-version>1.4.0</tycho-version>
		<eclipse-p2-base>http://download.eclipse.org/releases/2019-03</eclipse-p2-base>
	</properties>

	<build>
		<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>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
				<configuration>
                    <target>
                        <artifact>
                            <groupId>hu.blackbelt.epsilon</groupId>
                            <artifactId>hu.blackbelt.epsilon.runtime.targetdefinition</artifactId>
                            <version>${project.version}</version>
                        </artifact>
                    </target>
                    <environments>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86</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-versions-plugin</artifactId>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
					<!-- https://stackoverflow.com/questions/36328154/maven-deploy-plugin-deployatend-not-working -->
					<!-- <configuration> <deployAtEnd>true</deployAtEnd> </configuration> -->
				</plugin>

				<plugin>
					<groupId>hu.blackbelt.epsilon</groupId>
					<artifactId>epsilon-maven-plugin</artifactId>
					<version>${epsilon.maven.plugin.version}</version>
				</plugin>

				<!--This plugin's configuration is used to store Eclipse m2e settings
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											hu.blackbelt.epsilon
										</groupId>
										<artifactId>
											epsilon-maven-plugin
										</artifactId>
										<versionRange>
											[1.1.1,)
										</versionRange>
										<goals>
											<goal>execute</goal>
											<goal>
												executeConfiguration
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-resources-plugin
										</artifactId>
										<versionRange>[2.4.3,)</versionRange>
										<goals>
											<goal>testResources</goal>
											<goal>resources</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.eclipse.tycho
										</groupId>
										<artifactId>
											tycho-packaging-plugin
										</artifactId>
										<versionRange>
											[1.3.0,)
										</versionRange>
										<goals>
											<goal>validate-id</goal>
											<goal>
												validate-version
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.eclipse.tycho
										</groupId>
										<artifactId>
											tycho-compiler-plugin
										</artifactId>
										<versionRange>
											[1.3.0,)
										</versionRange>
										<goals>
											<goal>compile</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.eclipse.tycho.extras
										</groupId>
										<artifactId>
											tycho-eclipserun-plugin
										</artifactId>
										<versionRange>
											[1.3.0,)
										</versionRange>
										<goals>
											<goal>eclipse-run</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.fornax.toolsupport
										</groupId>
										<artifactId>
											fornax-oaw-m2-plugin
										</artifactId>
										<versionRange>
											[3.6.0,)
										</versionRange>
										<goals>
											<goal>run-workflow</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.codehaus.mojo
										</groupId>
										<artifactId>
											exec-maven-plugin
										</artifactId>
										<versionRange>
											[1.4.0,)
										</versionRange>
										<goals>
											<goal>java</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-dependency-plugin
										</artifactId>
										<versionRange>
											[2.8,)
										</versionRange>
										<goals>
											<goal>properties</goal>
											<goal>
												copy-dependencies
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-versions-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-surefire-plugin</artifactId>
					<version>${tycho-version}</version>
				</plugin>

				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.8</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.2.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.6</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<profiles>
        <profile>
            <id>modules</id>
            <activation>
                <property>
                    <name>github_release</name>
                    <value>!true</value>
                </property>
            </activation>
            <modules>
                <module>targetdefinition</module>
                <module>epsilon-runtime-eclipse</module>
                <module>feature</module>
                <module>site</module>
            </modules>
        </profile>

        <profile>
            <id>sign-artifacts</id>
            <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>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphraseServerId>${gpg.keyname}</passphraseServerId>
                                    <!-- This is necessary for gpg to not try to use the pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
			<id>release-dummy</id>
			<distributionManagement>
				<snapshotRepository>
					<id>dummy-distribution</id>
					<url>file:///tmp/maven-snapshot/</url>
				</snapshotRepository>
				<repository>
					<id>dummy-distribution</id>
					<url>file:///tmp/maven-release/</url>
				</repository>
			</distributionManagement>
		</profile>

		<profile>
			<id>release-judong</id>
			<distributionManagement>
				<snapshotRepository>
					<id>judong-nexus-distribution</id>
					<url>${env.JUDONG_MAVEN_UPSTREAM_SNAPSHOT}</url>
				</snapshotRepository>
				<repository>
					<id>judong-nexus-distribution</id>
					<url>${env.JUDONG_MAVEN_UPSTREAM_RELEASE}</url>
				</repository>
			</distributionManagement>
		</profile>

		<profile>
            <id>release-central</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<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>
		</profile>

        <profile>
            <id>release-github</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>de.jutzig</groupId>
                        <artifactId>github-release-plugin</artifactId>
                        <version>1.3.0</version>
                        <inherited>false</inherited>
                        <configuration>
                            <repositoryId>${project-repositoryId}</repositoryId>
                            <description>
                                **Branch:** ${env.WERCKER_GIT_BRANCH}
                                **P2 Update Site:** https://nexus.blackbelt.cloud/repository/p2-judo/${project-shortname}/${project.version}
                                **Maven repository:** https://nexus.blackbelt.cloud/#browse/browse:maven-judo-release:hu%2Fblackbelt%2Feclipse%2F${project-shortname}
                                **Wercker:** https://app.wercker.com/${project-repositoryId}/runs/build/${env.WERCKER_RUN_ID}
                            </description>
                            <releaseName>${project.version}</releaseName>
                            <prerelease>true</prerelease>
                            <tag>${project.version}</tag>
                            <deleteRelease>true</deleteRelease>
                            <commitish>${env.WERCKER_GIT_COMMIT}</commitish>
                            <fileSets>
                                <fileSet>
                                    <directory>${basedir}/epsilon-runtime-eclipse/target</directory>
                                    <includes>
                                        <include>*.jar</include>
                                    </includes>
                                </fileSet>
                                <fileSet>
                                    <directory>${basedir}/site/target</directory>
                                    <includes>
                                        <include>*.zip</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                        <executions>
                            <execution>
                                <id>release-to-github</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>release</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

		<profile>
			<id>release-p2-judong</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>wagon-maven-plugin</artifactId>
						<version>2.0.0</version>
						<executions>
							<execution>
								<id>upload-respoitory</id>
								<phase>deploy</phase>
								<goals>
									<goal>upload</goal>
								</goals>
								<configuration>
									<serverId>judong-nexus-distribution</serverId>
									<fromDir>${basedir}/site/target/repository</fromDir>
									<includes>*/**</includes>
									<url>dav:${env.JUDONG_P2_UPSTREAM}</url>
									<toDir>${project-shortname}/${project.version}</toDir>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
    </profiles>
</project>
