<?xml version="1.0" encoding="UTF-8"?>
<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.robrua.nlp</groupId>
	<artifactId>easy-bert</artifactId>
	<version>1.0.3</version>

	<name>easy-bert</name>
	<description>A Dead Simple BERT API (https://github.com/google-research/bert)</description>
	<url>https://github.com/robrua/easy-bert</url>

	<developers>
		<developer>
			<id>robrua</id>
			<name>Rob Rua</name>
			<email>robertrua@gmail.com</email>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>https://opensource.org/licenses/MIT</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git@github.com:robrua/easy-bert.git</connection>
		<developerConnection>scm:git:git@github.com:robrua/easy-bert.git</developerConnection>
		<url>git@github.com:robrua/easy-bert.git</url>
	</scm>

	<repositories>
		<repository>
			<id>snapshots-repo</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</repository>
	</repositories>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven-compiler.version>3.8.0</maven-compiler.version>
		<maven-source.version>3.0.1</maven-source.version>
		<maven-javadoc.version>3.1.0</maven-javadoc.version>
		<maven-resources.version>3.1.0</maven-resources.version>
		<maven-install.version>2.5.2</maven-install.version>
		<maven-deploy.version>2.8.2</maven-deploy.version>
		<exec-maven.version>1.6.0</exec-maven.version>
		<dockerfile-maven.version>1.4.10</dockerfile-maven.version>
		<maven-gpg.version>1.6</maven-gpg.version>
		<nexus-maven.version>1.6.8</nexus-maven.version>
		<license-maven.plugin>1.20</license-maven.plugin>
		<maven-shade.version>3.2.1</maven-shade.version>

		<jackson.version>2.9.8</jackson.version>
		<guava.version>27.1-jre</guava.version>
		<tensorflow.version>1.13.1</tensorflow.version>

		<docker.image>robrua/easy-bert</docker.image>
		<docker.tag>cpu</docker.tag>
		<docker.directory>docker/cpu</docker.directory>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson.version}</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>${guava.version}</version>
		</dependency>
		<dependency>
			<groupId>org.tensorflow</groupId>
			<artifactId>tensorflow</artifactId>
			<version>${tensorflow.version}</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler.version}</version>
				<configuration>
					<encoding>${project.build.sourceEncoding}</encoding>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<version>${maven-source.version}</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven-javadoc.version}</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<phase>verify</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>release</id>
			<distributionManagement>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
				<repository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>

			<build>
				<plugins>
					<plugin>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven-gpg.version}</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>${nexus-maven.version}</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>shaded</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>license-maven-plugin</artifactId>
						<version>${license-maven.version}</version>
						<configuration>
							<excludedScopes>system,test</excludedScopes>
						</configuration>
						<executions>
							<execution>
								<id>add-third-party</id>
								<goals>
									<goal>add-third-party</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-shade-plugin</artifactId>
						<version>${maven-shade.version}</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>shade</goal>
								</goals>
								<configuration>
									<finalName>${project.build.finalName}-jar-with-dependencies</finalName>
									<minimizeJar>true</minimizeJar>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>python</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-install-plugin</artifactId>
						<version>${maven-install.version}</version>
						<configuration>
							<skip>true</skip>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<version>${maven-deploy.version}</version>
						<configuration>
							<skip>true</skip>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>${exec-maven.version}</version>
						<executions>
							<execution>
								<id>install</id>
								<goals>
									<goal>exec</goal>
								</goals>
								<phase>install</phase>
								<configuration>
									<executable>python</executable>
									<arguments>
										<argument>setup.py</argument>
										<argument>install</argument>
									</arguments>
								</configuration>
							</execution>
							<execution>
								<id>deploy</id>
								<goals>
									<goal>exec</goal>
								</goals>
								<phase>deploy</phase>
								<configuration>
									<executable>python</executable>
									<arguments>
										<argument>setup.py</argument>
										<argument>sdist</argument>
										<argument>upload</argument>
									</arguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>docker</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<version>${maven-resources.version}</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>copy-resources</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<outputDirectory>${basedir}</outputDirectory>
							<overwrite>true</overwrite>
							<resources>
								<resource>
									<directory>${docker.directory}</directory>
									<includes>
										<include>Dockerfile</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</plugin>
					<plugin>
						<groupId>com.spotify</groupId>
						<artifactId>dockerfile-maven-plugin</artifactId>
						<version>${dockerfile-maven.version}</version>
						<executions>
							<execution>
								<id>build</id>
								<phase>package</phase>
								<goals>
									<goal>build</goal>
								</goals>
							</execution>
							<execution>
								<id>push</id>
								<phase>deploy</phase>
								<goals>
									<goal>push</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<repository>${docker.image}</repository>
							<tag>${docker.tag}</tag>
							<pullNewerImage>false</pullNewerImage>
							<useMavenSettingsForAuth>true</useMavenSettingsForAuth>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>gpu</id>
			<properties>
				<docker.tag>gpu</docker.tag>
				<docker.directory>docker/gpu</docker.directory>
			</properties>
			<dependencies>
				<dependency>
					<groupId>org.tensorflow</groupId>
					<artifactId>libtensorflow</artifactId>
					<version>${tensorflow.version}</version>
				</dependency>
				<dependency>
					<groupId>org.tensorflow</groupId>
					<artifactId>libtensorflow_jni_gpu</artifactId>
					<version>${tensorflow.version}</version>
				</dependency>
			</dependencies>
		</profile>
	</profiles>
</project>
