<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.1.6</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>
	
	<commons-configuration2.version>2.11.0</commons-configuration2.version>
	<jna.version>5.15.0</jna.version>
	<junit-jupiter.version>5.11.3</junit-jupiter.version>
	<assertj.version>3.26.3</assertj.version>
	<system-stubs-jupiter.version>2.0.3</system-stubs-jupiter.version>
	<slf4j.version>2.0.16</slf4j.version>
    <logback.version>1.3.14</logback.version>
    <rhino-runtime.version>1.7.15</rhino-runtime.version>
    <delight-rhino-sandbox.version>0.0.17</delight-rhino-sandbox.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.apache.commons</groupId>
      <artifactId>commons-configuration2</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>ch.qos.logback</groupId>
        <artifactId>logback-classic</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.apache.commons</groupId>
        <artifactId>commons-configuration2</artifactId>
        <version>${commons-configuration2.version}</version>
	  </dependency>
      <dependency>
        <groupId>org.javadelight</groupId>
        <artifactId>delight-rhino-sandbox</artifactId>
        <version>${delight-rhino-sandbox.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mozilla</groupId>
        <artifactId>rhino-runtime</artifactId>
        <version>${rhino-runtime.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</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>
        <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 compile target, optimize -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- build the optional source.jar -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>jar</id>
            <goals>
              <goal>jar</goal>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- build the optional javadoc.jar -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <!-- add this to disable checking -->
	    <configuration>
	      <doclint>none</doclint>
	      <source>8</source>
	    </configuration>
      </plugin>
      <plugin>
        <!-- Build the fat jar with all dependencies -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <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.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.7.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.13.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.1.3</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.7</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>3.1.3</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.4.2</version>
        </plugin>
	    <plugin>
	        <groupId>org.apache.maven.plugins</groupId>
	        <artifactId>maven-javadoc-plugin</artifactId>
	        <version>3.11.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.3.1</version>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>3.5.2</version>
        </plugin>
        
        <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.7.0</version>
        </plugin>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>5.1.9</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>
			<activation>
				<jdk>[16,)</jdk>
			</activation>
            <build>
                <plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
						    <!-- let the test pass under JDK16+ -->
							<argLine>--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED</argLine>
						</configuration>
					</plugin>
                </plugins>
            </build>
			
		</profile>	
        <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.5.0</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>2.2.0</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>
                        <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>

