<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright (C) 2016 Red Hat, Inc.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->
<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>

	<parent>
		<groupId>org.basepom</groupId>
		<artifactId>basepom-oss</artifactId>
		<version>23</version>
		<relativePath />
	</parent>

	<groupId>io.syndesis</groupId>
	<artifactId>syndesis-parent</artifactId>
	<version>1.2.2</version>
	<packaging>pom</packaging>

	<name>Syndesis :: Parent</name>
	<description>syndesis :: ${project.artifactId}</description>

	<properties>
		<!-- Global Syndesis version -->
		<syndesis.version>${project.version}</syndesis.version>
		<syndesis.policy.version>2</syndesis.policy.version>

		<!-- Atlasmap version-->
		<atlasmap.version>1.32.2</atlasmap.version>

		<!-- Image names -->
		<image.s2i>syndesis/syndesis-s2i:%l</image.s2i>
		<image.rest>syndesis/syndesis-rest:%l</image.rest>
		<image.verifier>syndesis/syndesis-verifier:%l</image.verifier>
		<image.ui>syndesis/syndesis-ui:%l</image.ui>


		<fabric8.maven.plugin.version>3.5.33</fabric8.maven.plugin.version>
		<maven.exec.plugin.version>1.2.1</maven.exec.plugin.version>
		<clean-maven-plugin-version>2.4.1</clean-maven-plugin-version>
		<frontend-maven-plugin-version>1.6</frontend-maven-plugin-version>
		<node.version>v8.9.1</node.version>
		<yarn.version>v1.2.1</yarn.version>

		<jackson.version>2.8.10</jackson.version>

		<spring-boot.version>1.5.8.RELEASE</spring-boot.version>

		<swagger.version>1.5.16</swagger.version>

		<activemq.version>5.15.2</activemq.version>

		<!-- Global camel version used everywhere -->
		<camel.version>2.20.1</camel.version>

		<!-- Don't fork based on cores, doesn't work nicely in the cloud -->
		<basepom.test.fork-count>1</basepom.test.fork-count>
		<basepom.failsafe.fork-count>1</basepom.failsafe.fork-count>
		<basepom.failsafe.reuse-vm>true</basepom.failsafe.reuse-vm>
        <!-- takes a really long time -->
        <basepom.check.skip-dependency-versions-check>true</basepom.check.skip-dependency-versions-check>

		<!-- Plugin versions -->
		<exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
	</properties>

	<modules>
		<module>runtime</module>
		<module>core</module>
		<module>connectors</module>
		<module>rest</module>
		<module>s2i</module>
		<module>verifier</module>
		<module>ui</module>
	</modules>

	<profiles>

		<!--
		=========================================================================
		Profiles (which can and should be combined)
		=========================================================================
		-->

		<!-- Profile for building Docker images -->
		<profile>
			<id>image</id>
			<activation>
				<property>
					<name>::image</name>
				</property>
			</activation>

			<modules>
				<module>rest</module>
				<module>verifier</module>
				<module>ui</module>
			</modules>

			<build>
				<defaultGoal>install</defaultGoal>
			</build>
		</profile>

		<!-- No checks enabled -->
		<profile>
			<id>skip-checks</id>
			<properties>
				<basepom.check.skip-all>true</basepom.check.skip-all>
			</properties>
		</profile>

		<!-- All checks enabled -->
		<profile>
			<id>checks</id>
			<properties>
				<basepom.check.skip-all>false</basepom.check.skip-all>
			</properties>
		</profile>

		<!-- System tests enabled -->
		<profile>
			<id>system-tests</id>
			<modules>
				<module>tests</module>
			</modules>
		</profile>

		<!-- Build Docker images directly -->
		<profile>
			<id>docker</id>
			<properties>
				<fabric8.mode>kubernetes</fabric8.mode>
			</properties>
		</profile>

		<!-- Build with OpenShift S2I -->
		<profile>
			<id>s2i</id>
			<properties>
				<fabric8.mode>openshift</fabric8.mode>
			</properties>
		</profile>

		<!-- Like 'no-checks' but even more aggresive (like even no tests)  -->
		<profile>
			<id>flash</id>
			<activation>
				<property>
					<name>deploy</name>
				</property>
			</activation>
			<properties>
				<basepom.check.skip-all>true</basepom.check.skip-all>
			</properties>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-resources-plugin</artifactId>
						<executions>
							<execution>
								<id>default-testResources</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-compiler-plugin</artifactId>
						<executions>
							<execution>
								<id>default-testCompile</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.basepom.maven</groupId>
						<artifactId>property-helper-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>get-build-id</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>pl.project13.maven</groupId>
						<artifactId>git-commit-id-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-enforcer-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
							<execution>
								<id>default-it</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-tests</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-sources</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>com.ning.maven.plugins</groupId>
						<artifactId>maven-dependency-versions-check-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>com.hubspot.maven.plugins</groupId>
						<artifactId>dependency-management-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.basepom.maven</groupId>
						<artifactId>duplicate-finder-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>findbugs-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-pmd-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>com.mycila</groupId>
						<artifactId>license-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-surefire-plugin</artifactId>
						<executions>
							<execution>
								<id>default-test</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>${exec-maven-plugin.version}</version>
						<executions>
							<execution>
								<phase />
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-failsafe-plugin</artifactId>
						<executions>
							<execution>
								<id>default</id>
								<phase />
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>deploy-local-nexus</id>
			<distributionManagement>
				<snapshotRepository>
					<id>openshift-nexus</id>
					<!-- replace with your cluster address -->
					<!--<url>http://nexus-syndesis.192.168.64.12.nip.io/nexus/content/repositories/snapshots</url>-->
				</snapshotRepository>
			</distributionManagement>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>openshift-nexus</serverId>
							<nexusUrl>http://nexus-syndesis.192.168.64.12.nip.io/nexus/</nexusUrl>
							<skipStaging>true</skipStaging>
							<skipLocalStaging>true</skipLocalStaging>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.mycila</groupId>
					<artifactId>license-maven-plugin</artifactId>
                    <inherited>false</inherited>
					<configuration>
						<header>license/syndesis-license.txt</header>
						<skipExistingHeaders>false</skipExistingHeaders>
						<!-- Reduce this even further. Vote for https://github.com/mycila/license-maven-plugin/pull/133
								 to make this a fixed thread number value -->
						<concurrencyFactor>1</concurrencyFactor>
						<mapping combine.children="append">
							<provides>SCRIPT_STYLE</provides>
							<assemble>SCRIPT_STYLE</assemble>
						</mapping>
						<includes>
							<include>**/src/**</include>
							<include>**/pom.xml</include>
						</includes>
						<excludes>
							<exclude>**/node_modules/**</exclude>
							<exclude>.editorconfig</exclude>
							<exclude>license.txt</exclude>
							<exclude>.mention-bot</exclude>
							<exclude>.mvn/wrapper/maven-wrapper.properties</exclude>
							<exclude>mvnw*</exclude>
							<exclude>**/resources/**/test-*</exclude>
							<exclude>**/*.mustache</exclude>
							<exclude>**/test/resources/**</exclude>
							<exclude>**/spring.factories</exclude>
							<exclude>**/*.adoc</exclude>
							<exclude>**/archetypes/**/src/main/resources/archetype-resources/**</exclude>
							<exclude>**/s2i/src/main/docker/project/**</exclude>
							<exclude>**/Dockerfile</exclude>
							<exclude>**/*.ts</exclude>
							<exclude>**/*.scss</exclude>
							<exclude>**/*.html</exclude>
							<exclude>**/config.json*</exclude>
							<exclude>**/.gitkeep</exclude>
							<exclude>**/*.webapp</exclude>
							<exclude>**/browserconfig.xml</exclude>
							<exclude>connectors/connectors/**/springboot/*Configuration.java</exclude><!-- auto generated without headers -->
							<exclude>connectors/connectors/**/springboot/*Common.java </exclude><!-- auto generated without headers -->
							<exclude>rest/syndesis-builder-image-generator/image/**</exclude><!-- auto generated without headers -->
						</excludes>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>io.syndesis</groupId>
							<artifactId>syndesis-policy</artifactId>
							<version>${syndesis.policy.version}</version>
						</dependency>
					</dependencies>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-checkstyle-plugin</artifactId>
					<configuration>
						<configLocation>/checkstyle/checkstyle-syndesis.xml</configLocation>
					</configuration>
					<dependencies>
						<dependency>
							<groupId>io.syndesis</groupId>
							<artifactId>syndesis-policy</artifactId>
							<version>${syndesis.policy.version}</version>
						</dependency>
					</dependencies>
				</plugin>

				<plugin>
					<groupId>io.fabric8</groupId>
					<artifactId>fabric8-maven-plugin</artifactId>
					<version>${fabric8.maven.plugin.version}</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.10.4</version>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
							<configuration>
								<additionalparam>-Xdoclint:none</additionalparam>
							</configuration>
						</execution>
					</executions>
				</plugin>

			</plugins>
		</pluginManagement>
	</build>

	<!-- Common dependencies -->
	<dependencyManagement>

		<dependencies>

			<!-- TODO: Maybe import BOM ? -->
			<dependency>
				<groupId>org.apache.camel</groupId>
				<artifactId>camel-core</artifactId>
				<version>${camel.version}</version>
			</dependency>

			<dependency>
				<groupId>com.fasterxml.jackson.core</groupId>
				<artifactId>jackson-databind</artifactId>
				<version>${jackson.version}</version>
			</dependency>

			<dependency>
				<groupId>com.fasterxml.jackson.core</groupId>
				<artifactId>jackson-annotations</artifactId>
				<version>${jackson.version}</version>
			</dependency>

			<dependency>
				<groupId>com.fasterxml.jackson.datatype</groupId>
				<artifactId>jackson-datatype-jdk8</artifactId>
				<version>${jackson.version}</version>
			</dependency>

			<dependency>
				<groupId>com.fasterxml.jackson.module</groupId>
				<artifactId>jackson-module-jsonSchema</artifactId>
				<version>${jackson.version}</version>
			</dependency>

			<!-- ActiveMQ deps to override Spring Boot imported pom -->
			<dependency>
				<groupId>org.apache.activemq</groupId>
				<artifactId>activemq-client</artifactId>
				<version>${activemq.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.activemq</groupId>
				<artifactId>activemq-openwire-legacy</artifactId>
				<version>${activemq.version}</version>
			</dependency>

		</dependencies>

	</dependencyManagement>


	<!-- Metadata need to publish to central -->
	<url>https://syndesis.io/</url>
	<inceptionYear>2016</inceptionYear>

	<organization>
		<name>JBoss by Red Hat</name>
		<url>http://jboss.org</url>
	</organization>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Syndesis committers</name>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://github.com/syndesisio/syndesis.git</connection>
		<developerConnection>scm:git:ssh://git@github.com:syndesisio/syndesis.git</developerConnection>
		<url>http://github.com/syndesisio/syndesis</url>
	  <tag>1.2.2</tag>
  </scm>

	<distributionManagement>
		<snapshotRepository>
			<id>oss-sonatype-staging</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>oss-sonatype-staging</id>
			<name>Sonatype Staging Repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
		</repository>
	</distributionManagement>

	<issueManagement>
		<system>github</system>
		<url>https://github.com/syndesisio/syndesis.io/issues</url>
	</issueManagement>

</project>
