<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>com.github.paulcwarren</groupId>
	<artifactId>spring-content</artifactId>
	<version>0.3.0</version>
	<packaging>pom</packaging>

	<name>Spring Content</name>
	<url>https://github.com/paulcwarren/spring-content/</url>
	<description>Cloud-Native Headless Content Management Services (CMS) for Spring.

Integrates with Spring Data, Spring Data REST and Apache Solr</description>
	<organization>
		<name>Paul Warren</name>
		<url>https://github.com/paulcwarren</url>
	</organization>
	<issueManagement>
		<system>Github</system>
		<url>https://github.com/paulcwarren/spring-content/issues</url>
	</issueManagement>
	<ciManagement>
		<system>Travis CI</system>
		<url>https://travis-ci.org/paulcwarren/spring-content</url>
	</ciManagement>

	<scm>
		<url>https://github.com/paulcwarren/spring-content</url>
		<developerConnection>Paul Warren</developerConnection>
	</scm>

	<developers>
		<developer>
			<name>Paul Warren</name>
			<email>paul_c_warren@yahoo.com</email>
		</developer>
	</developers>

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

	<properties>
		<ginkgo4j-version>1.0.9</ginkgo4j-version>
		<springboot-version>2.0.4.RELEASE</springboot-version>
		<spring-cloud.version>Finchley.SR1</spring-cloud.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<docs.output.dir>../target/generated-docs/refs/${env.BUILD_TYPE}/</docs.output.dir>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<!-- Import dependency management from Spring Boot -->
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<version>${springboot-version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.springframework.cloud</groupId>
				<artifactId>spring-cloud-dependencies</artifactId>
				<version>${spring-cloud.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<modules>
		<module>./spring-content-autoconfigure</module>
		<module>./spring-content-commons</module>
		<module>./spring-content-docx4j</module>
		<module>./spring-content-fs</module>
		<module>./spring-content-fs-boot-starter</module>
		<module>./spring-content-jpa</module>
		<module>./spring-content-jpa-boot-starter</module>
		<module>./spring-content-mongo</module>
		<module>./spring-content-mongo-boot-starter</module>
		<module>./spring-content-rest</module>
		<module>./spring-content-rest-boot-starter</module>
		<module>./spring-content-s3</module>
		<module>./spring-content-s3-boot-starter</module>
        <module>./spring-content-renditions</module>
		<module>./spring-content-renditions-boot-starter</module>
		<module>./spring-content-solr</module>
		<module>./spring-content-solr-boot-starter</module>
		<module>./spring-content-elasticsearch</module>
		<module>./content-fs-spring-boot-starter</module>
		<module>./content-jpa-spring-boot-starter</module>
		<module>./content-mongo-spring-boot-starter</module>
		<module>./content-rest-spring-boot-starter</module>
		<module>./content-s3-spring-boot-starter</module>
		<module>./content-solr-spring-boot-starter</module>
	</modules>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0-M1</version>
				<executions>
					<execution>
						<id>enforce-property</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireEnvironmentVariable>
									<variableName>BUILD_TYPE</variableName>
								</requireEnvironmentVariable>
							</rules>
							<fail>true</fail>
						</configuration>
					</execution>
				</executions>
			</plugin>

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

			<!-- unit test/coverage -->
			<plugin>
				<groupId>org.eluder.coveralls</groupId>
				<artifactId>coveralls-maven-plugin</artifactId>
				<version>3.1.0</version>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.7.8</version>
				<executions>
					<!-- Prepare execution with Surefire -->
					<execution>
						<id>pre-unit-test</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
					<!-- Generate report after tests are run -->
					<execution>
						<id>post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.18.1</version>
				<configuration>
					<argLine>${surefireArgLine}</argLine>
				</configuration>
				<executions>
					<execution>
						<id>run-unit-tests</id>
						<goals>
							<goal>test</goal>
						</goals>

					</execution>
				</executions>
			</plugin>

			<!-- Doc Publishing -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-scm-publish-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
 					<!--<providerImplementations>-->
						<!--<git>jgit</git>-->
					<!--</providerImplementations>-->
					<checkoutDirectory>${project.build.directory}/scmpublish</checkoutDirectory>
					<checkinComment>Publishing reference guides for
						${project.artifactId}:${project.version}</checkinComment>
					<content>${basedir}/target/generated-docs</content>
					<skipDeletedFiles>true</skipDeletedFiles>
					<!-- <dryRun>true</dryRun> -->
					<pubScmUrl>scm:git:https://github.com/paulcwarren/spring-content.git</pubScmUrl>
					<scmBranch>gh-pages</scmBranch> <!-- branch with static site -->
					<username>${env.GITHUB_USERNAME}</username>
					<password>${env.GITHUB_PASSWORD}</password>
					<ignorePathsToDelete>
						<ignorePathToDelete>/*</ignorePathToDelete>
					</ignorePathsToDelete>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.scm</groupId>
						<!--<artifactId>maven-scm-provider-jgit</artifactId>-->
						<artifactId>maven-scm-provider-gitexe</artifactId>
						<version>1.9.5</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>

	<profiles>
   		<profile>
			<id>dev</id>
		</profile>
		<profile>
			<id>docs</id>
			<build>
				<plugins>
					<!-- Docs Rendering -->
					<plugin>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctor-maven-plugin</artifactId>
						<configuration>
					        <backend>html</backend>
					        <doctype>book</doctype>
					        <attributes>
							    <version>${project.version}</version>
					        </attributes>
					        <outputDirectory>${docs.output.dir}</outputDirectory>
					    </configuration>
					    <executions>
					        <execution>
					            <id>output-html</id>
					            <phase>generate-resources</phase>
					            <goals>
					                <goal>process-asciidoc</goal>
					            </goals>
					        </execution>
					    </executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>ci</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>
						<version>2.4</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</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>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

</project>
