<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.alexbeardsley</groupId>
	<artifactId>bookeo-api</artifactId>
	<version>0.1.1</version>
	<packaging>jar</packaging>
	
	<name>Bookeo API</name>
	<description>A Java implementation of the Bookeo API.</description>
	<url>https://github.com/alexbeardsley/bookeo-api</url>
	<licenses>
		<license>
			<name>The MIT License (MIT)</name>
			<url>https://tldrlegal.com/license/mit-license</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<developers>
		<developer>
			<id>alexbeardsley</id>
			<name>Alex Beardsley</name>
			<email>alex@alexbeardsley.com</email>
		</developer>
	</developers>
	<scm>
		<connection>scm:git:git://github.com/alexbeardsley/bookeo-api.git</connection>
		<developerConnection>scm:git:git@github.com/alexbeardsley/bookeo-api.git</developerConnection>
		<url>http://github.com/alexbeardsley/bookeo-api.git</url>
	</scm>

	<repositories>
		<repository>
			<id>maven-restlet</id>
			<name>Public online Restlet repository</name>
			<url>http://maven.restlet.org</url>
		</repository>
	</repositories>

	<dependencies>
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-client</artifactId>
			<version>2.22.1</version>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-multipart</artifactId>
			<version>2.22.1</version>
		</dependency>	
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.10.19</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.swagger</groupId>
			<artifactId>swagger-core</artifactId>
			<version>1.5.3</version>
		</dependency>
		<dependency>
			<groupId>com.brsanthu</groupId>
			<artifactId>migbase64</artifactId>
			<version>2.2</version>
		</dependency>
	</dependencies>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>
	<build>
		<plugins>
			<plugin>
				<groupId>org.sonatype.plugins</groupId>
				<artifactId>nexus-staging-maven-plugin</artifactId>
				<version>1.6.6</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<!--  manually inspect the staging repository in Nexus and trigger a release of the staging repository later with
						mvn nexus-staging:release
					If you find something went wrong you can drop the staging repository with
						mvn nexus-staging:drop
					-->
					<autoReleaseAfterClose>false</autoReleaseAfterClose>
				</configuration>
			</plugin>
			
			<plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-compiler-plugin</artifactId>
	        <version>3.3</version>
	        <configuration>
	          <source>1.8</source>
	          <target>1.8</target>
	        </configuration>
	      </plugin>
		  <plugin>
	        <groupId>org.codehaus.mojo</groupId>
	        <artifactId>exec-maven-plugin</artifactId>
	        <version>1.4.0</version>
	        <executions>
	          <execution>
	            <phase>generate</phase>
	            <goals>
	              <goal>exec</goal>
	            </goals>
	          </execution>
	        </executions>
	        <configuration>
	          <executable>java</executable>
	          <arguments>
	            <argument>-jar</argument>
	            <argument>${basedir}/lib/swagger-codegen-cli.jar</argument>
	            <argument>generate</argument>
	            <argument>-i</argument>
	            <argument>http://www.bookeo.com/apiref/swagger.json</argument>
	            <argument>-l</argument>
	            <argument>java</argument>
	            <argument>-o</argument>
	          	<argument>${project.build.directory}/generated-sources/bookeo</argument>
	          	<argument>-c</argument>
	          	<argument>${basedir}/src/main/resources/bookeo-swagger-config.json</argument>
	          </arguments>	          
	        </configuration>
	      </plugin>
	      <plugin>
	        <groupId>org.codehaus.mojo</groupId>
	        <artifactId>build-helper-maven-plugin</artifactId>
	        <version>1.7</version>
	        <executions>
	          <execution>
	            <id>add-source</id>
	            <phase>generate-sources</phase>
	            <goals>
	              <goal>add-source</goal>
	            </goals>
	            <configuration>
	              <sources>
	                <source>${project.build.directory}\generated-sources\bookeo\src\main\java</source>
	              </sources>
	            </configuration>
	          </execution>
	        </executions>
	      </plugin>
		</plugins>
	</build>
	<profiles>
	  <profile> 
	    <id>release</id>
	    <build>
	      <plugins>
	      	<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.2.1</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.9.1</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<excludePackageNames>com.bookeo.api.*</excludePackageNames>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
	      </plugins>
	    </build>
	  </profile>
	</profiles>
</project>
