<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>io.featurehub.tooling</groupId>
	<artifactId>maven-openapi-publisher</artifactId>
	<version>1.1</version>
	<packaging>maven-plugin</packaging>
	<name>maven-openapi-publisher</name>

	<description>
		Parses OpenAPI files ready for publishing, stripping out data. See readme.
	</description>

  <url>https://featurehub.io</url>
  <developers>
    <developer>
      <email>irina@featurehub.io</email>
      <id>isouthwell</id>
      <name>Irina Southwell</name>
      <organization>Anyways Labs Ltd</organization>
    </developer>

    <developer>
      <email>richard@featurehub.io</email>
      <id>rvowles</id>
      <name>Richard Vowles</name>
      <organization>Anyways Labs Ltd</organization>
    </developer>
  </developers>

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

  <scm>
    <connection>scm:git:git@github.com:featurehub-io/featurehub.git</connection>
    <developerConnection>scm:git:git@github.com:featurehub-io/featurehub.git</developerConnection>
    <url>git@github.com:featurehub-io/featurehub.git</url>
    <tag>maven-openapi-publisher-1.1</tag>
  </scm>

	<properties>
		<openapi-codegen-version>6.2.1</openapi-codegen-version>
		<maven.compiler.target>1.11</maven.compiler.target>
		<maven.compiler.source>1.11</maven.compiler.source>
		<kotlin.version>1.7.10</kotlin.version>
		<jackson.version>2.14.1</jackson.version>
		<maven.version>3.8.7</maven.version>
	</properties>

	<prerequisites>
		<maven>3.8</maven>
	</prerequisites>

	<dependencies>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>1.15</version>
    </dependency>

		<dependency>
			<groupId>io.swagger.parser.v3</groupId>
			<artifactId>swagger-parser</artifactId>
			<version>2.1.11</version>
      <exclusions>
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
      </exclusions>
		</dependency>

    <dependency>
      <groupId>io.featurehub.sdk.composites</groupId>
      <artifactId>sdk-composite-logging</artifactId>
      <version>1.1</version>
    </dependency>

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

		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-stdlib-jdk8</artifactId>
			<version>[1.7.20]</version>
		</dependency>

		<dependency>
			<groupId>org.jetbrains.kotlin</groupId>
			<artifactId>kotlin-reflect</artifactId>
			<version>[1.7.20]</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-artifact</artifactId>
			<scope>provided</scope>
			<version>${maven.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-plugin-api</artifactId>
			<version>${maven.version}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-core</artifactId>
			<version>${maven.version}</version>
			<scope>provided</scope>
			<exclusions>
				<exclusion>
					<groupId>com.google.code.google-collections</groupId>
					<artifactId>google-collect</artifactId>
				</exclusion>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-annotations</artifactId>
			<scope>provided</scope>
			<version>3.7.1</version>
		</dependency>

		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-maven-plugin</artifactId>
			<scope>provided</scope>
			<version>1.3.8</version>
		</dependency>

		<dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
    </dependency>
	</dependencies>

	<build>
		<plugins>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.13</version>
        <executions>
          <execution>
            <id>deploy</id>
            <goals>
              <goal>deploy</goal>
            </goals>
            <phase>deploy</phase>
          </execution>
        </executions>
        <configuration>
          <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
          <serverId>sonatype-staging</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>

			<plugin>
				<groupId>org.codehaus.plexus</groupId>
				<artifactId>plexus-component-metadata</artifactId>
				<version>2.1.1</version>
				<executions>
					<execution>
						<goals>
							<goal>generate-metadata</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
				<version>3.7.1</version>
				<configuration>
					<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
				</configuration>
				<executions>
					<!-- if you want to generate help goal -->
					<execution>
						<id>generated-helpmojo</id>
						<goals>
							<goal>helpmojo</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<!-- source plugin \> = 2.1 is required to use the no-fork goals -->
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.jetbrains.kotlin</groupId>
				<artifactId>kotlin-maven-plugin</artifactId>
				<version>${kotlin.version}</version>
				<executions>
					<execution>
						<id>compile</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<sourceDirs>
								<sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
								<sourceDir>${project.basedir}/src/main/java</sourceDir>
								<jvmTarget>11</jvmTarget>
							</sourceDirs>
						</configuration>
					</execution>
					<execution>
						<id>test-compile</id>
						<goals> <goal>test-compile</goal> </goals>
						<configuration>
							<sourceDirs>
								<sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
								<sourceDir>${project.basedir}/src/test/java</sourceDir>
								<jvmTarget>11</jvmTarget>
							</sourceDirs>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<release>11</release>
					<source>11</source>
					<target>11</target>
					<executable>javac11</executable>
					<useIncrementalCompilation>false</useIncrementalCompilation>
				</configuration>
				<executions>
					<!-- Replacing default-compile as it is treated specially by maven -->
					<execution>
						<id>default-compile</id>
						<phase>none</phase>
						<configuration />
					</execution>
					<!-- Replacing default-testCompile as it is treated specially by maven -->
					<execution>
						<id>default-testCompile</id>
						<phase>none</phase>
						<configuration />
					</execution>
					<execution>
						<id>java-compile</id>
						<phase>compile</phase>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration />
					</execution>
					<execution>
						<id>java-test-compile</id>
						<phase>test-compile</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
						<configuration />
					</execution>
				</executions>
			</plugin>
			<!-- files ending in spec or test -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M3</version>
				<configuration>
					<includes>
						<include>**/*Test.java</include>
					</includes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.2.0</version>
				<configuration>
					<source>11</source>
					<detectJavaApiLink>false</detectJavaApiLink>
				</configuration>
			</plugin>

			<!-- ensure we know what our licenses are -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>2.0.0</version>
				<executions>
					<execution>
						<id>licences</id>
						<goals>
							<goal>add-third-party</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>io.repaint.maven</groupId>
				<artifactId>tiles-maven-plugin</artifactId>
				<version>2.23</version>
				<extensions>true</extensions>
				<configuration>
					<filtering>false</filtering>
					<tiles>
						<tile>io.featurehub.sdk.tiles:tile-release:[1.1,2)</tile>
					</tiles>
				</configuration>
			</plugin>

		</plugins>
	</build>

</project>
