<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>io.apicurio</groupId>
	<artifactId>apicurio-data-models</artifactId>
	<version>1.0.2.Final</version>
	<name>apicurio-data-models</name>

	<url>https://www.apicur.io/</url>
	<description>Open Source API Design Studio</description>

	<organization>
		<name>Red Hat</name>
		<url>https://www.redhat.com</url>
	</organization>

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

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/apicurio/apicurio-data-models/issues</url>
	</issueManagement>

	<scm>
		<connection>scm:git:git@github.com:apicurio/apicurio-data-models.git</connection>
		<developerConnection>scm:git:git@github.com:apicurio/apicurio-data-models.git</developerConnection>
		<url>scm:git:git@github.com:apicurio/apicurio-data-models.git</url>
	</scm>

    <developers>
        <developer>
            <name>Eric Wittmann</name>
            <id>EricWittmann</id>
            <email>eric.wittmann@redhat.com</email>
            <organization>Red Hat</organization>
            <roles>
                <role>Project Lead</role>
                <role>Developer</role>
            </roles>
            <timezone>-5</timezone>
        </developer>
    </developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
		<timestamp>${maven.build.timestamp}</timestamp>

		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>

		<version.frontend-maven.plugin>1.7.6</version.frontend-maven.plugin>

		<version.com.fasterxml.jackson>2.9.9</version.com.fasterxml.jackson>
		<version.com.fasterxml.jackson.dataformat>2.9.9</version.com.fasterxml.jackson.dataformat>
		<version.commons-io>2.6</version.commons-io>
		<version.junit>4.12</version.junit>
		<version.org.jsweet>2.2.0</version.org.jsweet>
		<version.org.skyscreamer>1.5.0</version.org.skyscreamer>
	</properties>

	<pluginRepositories>
		<pluginRepository>
			<id>jsweet-plugins-release</id>
			<name>plugins-release</name>
			<url>http://repository.jsweet.org/artifactory/plugins-release-local</url>
		</pluginRepository>
	</pluginRepositories>

	<repositories>
		<repository>
			<id>jsweet-central</id>
			<name>libs-release</name>
			<url>http://repository.jsweet.org/artifactory/libs-release-local</url>
		</repository>
	</repositories>

	<dependencies>
		<!-- Third Party Deps -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>${version.com.fasterxml.jackson}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${version.com.fasterxml.jackson}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-yaml</artifactId>
			<version>${version.com.fasterxml.jackson.dataformat}</version>
		</dependency>

		<!-- Test Only Deps -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${version.junit}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${version.commons-io}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.skyscreamer</groupId>
			<artifactId>jsonassert</artifactId>
			<version>${version.org.skyscreamer}</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.jsweet
										</groupId>
										<artifactId>
											jsweet-maven-plugin
										</artifactId>
										<versionRange>
											[1.0.0,)
										</versionRange>
										<goals>
											<goal>jsweet</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<source>${maven.compiler.source}</source>
					<target>${maven.compiler.target}</target>
					<fork>true</fork>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.1.0</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>3.1.0</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Generate TS from Java -->
			<plugin>
				<groupId>org.jsweet</groupId>
				<artifactId>jsweet-maven-plugin</artifactId>
				<version>${version.org.jsweet}</version>
				<configuration>
					<verbose>true</verbose>
					<tsOut>target/ts/src</tsOut>
					<targetVersion>ES6</targetVersion>
					<module>umd</module>
					<moduleResolution>classic</moduleResolution>
					<tsOnly>true</tsOnly>
					<excludes>
						<exclude>**/_*/**</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<id>generate-js</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>jsweet</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
					<!-- Copy TS env from src into target -->
					<execution>
						<id>copy-ts</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/ts</outputDirectory>
							<overwrite>true</overwrite>
							<resources>
								<resource>
									<directory>${basedir}/src/main/ts</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
					<!-- Copy test fixtures into ts env -->
					<execution>
						<id>copy-fixtures</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/ts/tests/fixtures</outputDirectory>
							<overwrite>true</overwrite>
							<resources>
								<resource>
									<directory>${basedir}/src/test/resources/fixtures</directory>
									<filtering>false</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- Generate the core.ts file -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.6.0</version>
				<executions>
					<execution>
						<id>generate-corets</id>
						<phase>package</phase>
						<goals>
							<goal>java</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<mainClass>io.apicurio.datamodels._build.GenerateCoreTs</mainClass>
					<arguments>
						<argument>${basedir}/target/ts/src</argument>
					</arguments>
				</configuration>
			</plugin>
			<!-- Build the TS into a library bundle -->
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<version>${version.frontend-maven.plugin}</version>
				<executions>
					<!-- Install Node and Yarn -->
					<execution>
						<id>install node and yarn</id>
						<goals>
							<goal>install-node-and-yarn</goal>
						</goals>
						<phase>generate-sources</phase>
						<configuration>
							<workingDirectory>${basedir}/target/ts</workingDirectory>
							<nodeVersion>v8.15.0</nodeVersion>
							<yarnVersion>v1.15.2</yarnVersion>
						</configuration>
					</execution>
					<!-- Install npm/yarn dependencies -->
					<execution>
						<id>yarn install</id>
						<goals>
							<goal>yarn</goal>
						</goals>
						<phase>generate-sources</phase>
						<configuration>
							<workingDirectory>${basedir}/target/ts</workingDirectory>
							<arguments>install</arguments>
						</configuration>
					</execution>
					<!-- Test the library -->
					<execution>
						<id>ng test</id>
						<goals>
							<goal>yarn</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<workingDirectory>${basedir}/target/ts</workingDirectory>
							<arguments>test</arguments>
						</configuration>
					</execution>
					<!-- Build+package the library -->
					<execution>
						<id>ng build</id>
						<goals>
							<goal>yarn</goal>
						</goals>
						<phase>package</phase>
						<configuration>
							<workingDirectory>${basedir}/target/ts</workingDirectory>
							<arguments>package</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

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

	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.8</version>
						<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-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>java8</id>
			<activation>
				<jdk>[1.8,)</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<doclint>none</doclint>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
