<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.andyserver.maven.plugins</groupId>
	<artifactId>jenkinsfile-maven-plugin</artifactId>
	<version>1.0.1</version>
	<packaging>maven-plugin</packaging>

	<name>Jenkinsfile Maven Plugin</name>
    <description>Maven plugin to communicate with Jenkins server to validate Jenkinsfiles</description>
    <url>https://github.com/sabre1041/jenkinsfile-maven-plugin</url>

    <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>

    <scm>
        <connection>scm:git:git@github.com:sabre1041/jenkinsfile-maven-plugin.git</connection>
        <url>git@github.com:sabre1041/jenkinsfile-maven-plugin.git</url>
        <developerConnection>scm:git:git@github.com:sabre1041/jenkinsfile-maven-plugin.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
       <developer>
           <id>sabre1041</id>
           <name>Andrew Block</name>
           <email>andy.block@gmail.com</email>
       </developer>
    </developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.7</maven.compiler.source>
		<maven.compiler.target>1.7</maven.compiler.target>
		<maven.plugin.api.version>2.0</maven.plugin.api.version>
		<maven.plugin.annotations.versions>3.2</maven.plugin.annotations.versions>
		<maven.core.version>3.3.9</maven.core.version>
		<plexus.utils.version>3.0.8</plexus.utils.version>
		<http.client.version>4.5.2</http.client.version>
		<junit.version>4.8.2</junit.version>
		<maven.invoker.plugin.version>1.7</maven.invoker.plugin.version>
		<maven.plugin.plugin.version>3.2</maven.plugin.plugin.version>
		<maven.javadoc.plugin.version>2.10.4</maven.javadoc.plugin.version>
		<maven.source.plugin.version>3.0.1</maven.source.plugin.version>
		<maven.gpg.plugin.version>1.6</maven.gpg.plugin.version>
		<nexus.staging.maven.plugin.version>1.6.7</nexus.staging.maven.plugin.version>
	</properties>

    <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>

	<dependencies>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-plugin-api</artifactId>
			<version>${maven.plugin.api.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-annotations</artifactId>
			<version>${maven.plugin.annotations.versions}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-core</artifactId>
			<version>${maven.core.version}</version>
		</dependency>
		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-utils</artifactId>
			<version>${plexus.utils.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>${http.client.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>${http.client.version}</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
	    <pluginManagement>
	       <plugins>
		        <plugin>
		            <groupId>org.apache.maven.plugins</groupId>
		            <artifactId>maven-source-plugin</artifactId>
		            <version>${maven.source.plugin.version}</version>
		            <executions>
		                <execution>
		                    <id>attach-sources</id>
		                    <goals>
		                        <goal>jar-no-fork</goal>
		                    </goals>
		                </execution>
		            </executions>
		        </plugin>
		    </plugins>
	    </pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-plugin-plugin</artifactId>
				<version>${maven.plugin.plugin.version}</version>
				<configuration>
					<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
					<goalPrefix>jenkinsfile</goalPrefix>
				</configuration>
				<executions>
					<execution>
						<id>mojo-descriptor</id>
						<goals>
							<goal>descriptor</goal>
						</goals>
					</execution>
					<execution>
						<id>help-goal</id>
						<goals>
							<goal>helpmojo</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>run-its</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-invoker-plugin</artifactId>
						<version>${maven.invoker.plugin.version}</version>
						<configuration>
							<debug>true</debug>
							<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
							<pomIncludes>
								<pomInclude>*/pom.xml</pomInclude>
							</pomIncludes>
							<postBuildHookScript>verify</postBuildHookScript>
							<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
							<settingsFile>src/it/settings.xml</settingsFile>
							<goals>
								<goal>clean</goal>
								<goal>test-compile</goal>
							</goals>
						</configuration>
						<executions>
							<execution>
								<id>integration-test</id>
								<goals>
									<goal>install</goal>
									<goal>integration-test</goal>
									<goal>verify</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
		    <id>release</id>
		    <build>
		        <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.javadoc.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <additionalparam>-Xdoclint:none</additionalparam>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus.staging.maven.plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
		        </plugins>
		    </build>
		</profile>
	</profiles>

</project>
