<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>com.gentics</groupId>
		<artifactId>cms-oss</artifactId>
		<version>6.0.2</version>
	</parent>

	<groupId>com.gentics.cms-oss</groupId>
	<artifactId>cms-restapi</artifactId>
	<packaging>jar</packaging>
	<organization>
		<name>Gentics Software</name>
		<url>http://www.gentics.com/</url>
	</organization>
	<description>Contains Model classes for the Gentics CMS REST API</description>
	<name>Gentics CMS - REST API Library</name>
	<url>http://www.gentics.com</url>

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

	<build>
		<!-- TODO: remove this-->
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>**/contentnode.build.properties</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
				<includes>
					<include>**/*</include>
				</includes>
			</resource>
		</resources>

		<testResources>
			<testResource>
				<directory>src/test/java</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</testResource>
		</testResources>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>com.github.spotbugs</groupId>
				<artifactId>spotbugs-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>io.openapitools.swagger</groupId>
				<artifactId>swagger-maven-plugin</artifactId>
				<version>2.1.5</version>
				<configuration>
					<resourcePackages>
						<resourcePackage>com.gentics.contentnode.rest.resource</resourcePackage>
					</resourcePackages>
					<outputDirectory>${basedir}/../cms-oss-server/src/main/resources/webroot/openapi/</outputDirectory>
					<outputFilename>openapi</outputFilename>
					<outputFormats>JSON,YAML</outputFormats>
					<prettyPrint>true</prettyPrint>
					<swaggerConfig>
						<info>
							<title>GcmsApi</title>
							<description>${project.name}</description>
							<contact><url>${project.url}</url></contact>
							<version>${project.version}</version>
						</info>
						<components>
							<securitySchemes>
								<sid>
									<type>apikey</type>
									<description>CMS SID</description>
									<name>sid</name>
									<in>query</in>
								</sid>
							</securitySchemes>
						</components>
						<securityRequirements>
							<one>
								<entries>
									<entry>
										<name>sid</name>
									</entry>
								</entries>
							</one>
						</securityRequirements>
					</swaggerConfig>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.webcohesion.enunciate</groupId>
				<artifactId>enunciate-maven-plugin</artifactId>
				<version>${enunciate.version}</version>
				<executions>
					<execution>
						
						<goals>
							<goal>docs</goal>
						</goals>
						<configuration>
							<!-- the directory where to put the docs -->
							<docsDir>${project.build.directory}/docs</docsDir>
							<docsSubdir>.</docsSubdir>
							<configFile>src/conf/enunciate.xml</configFile>
						</configuration>
					</execution>
				</executions>

				<dependencies>
					<!-- Workaround for enunciate bug -->
					<dependency>
						<groupId>javax.annotation</groupId>
						<artifactId>javax.annotation-api</artifactId>
						<version>1.3</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<verbose>true</verbose>
					<fork>true</fork>
					<compilerVersion>1.8</compilerVersion>
					<source>1.8</source>
					<target>1.8</target>
					<maxmem>1024m</maxmem>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<!-- <failOnError>false</failOnError> -->
							<maxmemory>100M</maxmemory>
							<additionalparam>-Xdoclint:none</additionalparam>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<excludePomFiles>true</excludePomFiles>
					<archive>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<mainClass>com.gentics.contentnode.rest.version.Main</mainClass>
						</manifest>
						<manifestEntries>
							<url>${project.url}</url>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<id>dist</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<attach>true</attach>
							<appendAssemblyId>true</appendAssemblyId>
							<descriptors>
								<descriptor>${project.basedir}/src/assembly/doc-package.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.gentics.cms-oss</groupId>
				<artifactId>cms-oss-bom</artifactId>
				<type>pom</type>
				<scope>import</scope>
				<version>${project.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>com.webcohesion.enunciate</groupId>
			<artifactId>enunciate-core-annotations</artifactId>
		</dependency>

		<!-- Test dependencies -->
		<dependency>
			<artifactId>junit</artifactId>
			<groupId>junit</groupId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mariadb.jdbc</groupId>
			<artifactId>mariadb-java-client</artifactId>
			<type>jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.gentics</groupId>
			<artifactId>generic-testutils</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Provided dependencies -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.4.public_draft</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-multipart</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-client</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-json-jackson</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.connectors</groupId>
			<artifactId>jersey-apache-connector</artifactId>
			<version>${jersey.version}</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-sse</artifactId>
			<version>${jersey.version}</version>
		</dependency>
	</dependencies>
</project>
