<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>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>org.bidib.com.github.markusbernhardt</groupId>
  <artifactId>proxy-vole</artifactId>
  <version>1.0.13</version>

  <name>Proxy Vole</name>
  <description>Proxy Vole is a Java library to auto detect the platform network proxy settings.</description>
  <url>https://github.com/akuhtz/proxy-vole</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <downloadSources>true</downloadSources>
    <downloadJavadocs>true</downloadJavadocs>
    <java.version>1.8</java.version>
	<enforcer-no-snapshots.skip>false</enforcer-no-snapshots.skip>
	
	<jna.version>5.6.0</jna.version>
	<junit-jupiter.version>5.7.1</junit-jupiter.version>
	<assertj.version>3.18.1</assertj.version>
	<system-stubs-jupiter.version>1.2.0</system-stubs-jupiter.version>

  </properties>

  <scm>
    <url>https://github.com/akuhtz/proxy-vole</url>
    <connection>scm:git://github.com/akuhtz/proxy-vole.git</connection>
    <developerConnection>scm:git:ssh://git@github.com/akuhtz/proxy-vole.git</developerConnection>
  </scm>

  <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>

  <developers>
    <developer>
      <name>Markus Bernhardt</name>
      <email>markus.bernhardt@me.com</email>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna</artifactId>
    </dependency>
    <dependency>
      <groupId>net.java.dev.jna</groupId>
      <artifactId>jna-platform</artifactId>
    </dependency>
    <dependency>
      <groupId>org.ini4j</groupId>
      <artifactId>ini4j</artifactId>
    </dependency>
	<dependency>
	  <groupId>org.mozilla</groupId>
	  <artifactId>rhino-runtime</artifactId>
	</dependency>
    <dependency>
      <groupId>org.javadelight</groupId>
      <artifactId>delight-rhino-sandbox</artifactId>
	  <exclusions>
		<exclusion>
		  <groupId>org.mozilla</groupId>
		  <artifactId>rhino</artifactId>
		</exclusion>
	  </exclusions>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <!-- test dependencies -->
    <dependency>
	  <groupId>org.junit.jupiter</groupId>
	  <artifactId>junit-jupiter-engine</artifactId>
	  <scope>test</scope>
    </dependency>
	<dependency>
		<groupId>org.assertj</groupId>
		<artifactId>assertj-core</artifactId>
		<scope>test</scope>
	</dependency>

	<dependency>
	  <groupId>uk.org.webcompere</groupId>
	  <artifactId>system-stubs-jupiter</artifactId>
	  <scope>test</scope>
	</dependency>
  </dependencies>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna</artifactId>
        <version>${jna.version}</version>
      </dependency>
      <dependency>
        <groupId>net.java.dev.jna</groupId>
        <artifactId>jna-platform</artifactId>
        <version>${jna.version}</version>
      </dependency>
      <dependency>
        <groupId>org.ini4j</groupId>
        <artifactId>ini4j</artifactId>
        <version>0.5.4</version>
      </dependency>
      <dependency>
        <groupId>org.javadelight</groupId>
        <artifactId>delight-rhino-sandbox</artifactId>
        <version>0.0.15</version>
      </dependency>
      <dependency>
        <groupId>org.mozilla</groupId>
        <artifactId>rhino-runtime</artifactId>
        <version>1.7.13</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.30</version>
      </dependency>

      <!-- test dependencies -->
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit-jupiter.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj.version}</version>
      </dependency>
	  <dependency>
	    <groupId>uk.org.webcompere</groupId>
	    <artifactId>system-stubs-jupiter</artifactId>
	    <version>${system-stubs-jupiter.version}</version>
	  </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <!-- generate the osgi manifest -->
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
		<version>5.1.1</version>
        <extensions>true</extensions>
        <configuration>
          <!-- see http://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html -->
          <instructions>
            <!-- no 'uses' osgi directive -->
            <_nouses>true</_nouses>
            <_snapshot>${osgi-version-qualifier}</_snapshot>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- set the deploy plugin version -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>3.0.0-M1</version>
      </plugin>
      <plugin>
        <!-- set the compile target, optimize -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>
      <plugin>
        <!-- also download sources and javadocs whenever possible -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.10</version>
        <configuration>
          <downloadSources>${downloadSources}</downloadSources>
          <downloadJavadocs>${downloadJavadocs}</downloadJavadocs>
        </configuration>
      </plugin>
      <plugin>
        <!-- compress and index the generated jar files -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <archive>
            <compress>true</compress>
            <index>true</index>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <!-- build the optional source.jar -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>jar</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- build the optional javadoc.jar -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>jar</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <!-- add this to disable checking -->
	        <configuration>
	            <doclint>none</doclint>
	            <source>8</source>
	        </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Build the fat jar with all dependencies -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <archive>
            <manifest>
              <mainClass>com.github.markusbernhardt.proxy.ui.ProxyTester</mainClass>
            </manifest>
          </archive>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
        </plugin>
	    <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-javadoc-plugin</artifactId>
	        <version>3.2.0</version>
        </plugin>
        <plugin>
          <!-- ignore enforce plugin in the m2e lifecycle -->
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<version>3.0.0-M2</version>
						<executions>
							<execution>
								<id>enforce-no-snapshots</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<skip>${enforcer-no-snapshots.skip}</skip>
									<rules>
										<requireReleaseDeps>
											<message>No Snapshots Allowed!</message>
										</requireReleaseDeps>
									</rules>
									<fail>true</fail>
								</configuration>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>com.github.ferstl</groupId>
								<artifactId>pedantic-pom-enforcers</artifactId>
								<version>1.3.1</version>
							</dependency>
						</dependencies>
					</plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <inherited>true</inherited>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <!-- add this to disable checking -->
                                <configuration>
                                    <doclint>none</doclint>
                                    <source>8</source>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
							<!--
                            <passphrase>${gpg.passphrase}</passphrase>
                            <useAgent>${gpg.useagent}</useAgent>
							-->
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <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>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <!-- autoReleaseAfterClose>true</autoReleaseAfterClose -->
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

