<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>proxy</groupId>
	<artifactId>http_proxy</artifactId>
	<packaging>war</packaging>
	<version>1.7-SNAPSHOT</version>
	<name>http_proxy</name>
	<url>https://maven.apache.org</url>

	<!-- The SCM -->
	<scm>
		<connection>scm:git:[fetch=]git@github.com:geosolutions-it/http-proxy.git[push=]git@github.com:geosolutions-it/http-proxy.git</connection>
		<tag>master</tag>
		<url>https://github.com/geosolutions-it/http-proxy</url>
	</scm>

	<distributionManagement>
    <!--      GeoSolutions Repository     -->
      <repository>
        <uniqueVersion>false</uniqueVersion>
        <id>geosolutions</id>
        <url>sftp://maven.geo-solutions.it</url>
      </repository>
    </distributionManagement>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.15.0</version>
				<configuration>
					<source>17</source>
					<target>17</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.5.2</version>
				<configuration>
					<skip>false</skip>
				</configuration>
			</plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>make-a-jar</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.1.4</version>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>install-file</goal>
                        </goals>
                        <configuration>
                            <packaging>jar</packaging>
                            <artifactId>${project.artifactId}</artifactId>
                            <groupId>${project.groupId}</groupId>
                            <version>${project.version}</version>
                            <file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>3.1.4</version>
				<executions>
					<execution>
						<phase>deploy</phase>
						<goals>
							<goal>deploy-file</goal>
						</goals>
						<configuration>
							<packaging>jar</packaging>
							<generatePom>true</generatePom>
                                                        <pomFile>${basedir}/pom.xml</pomFile>
							<repositoryId>geosolutions</repositoryId>
							<url>${project.distributionManagement.repository.url}</url>
							<artifactId>${project.artifactId}</artifactId>
							<groupId>${project.groupId}</groupId>
							<version>${project.version}</version>
							<file>${project.build.directory}/${project.artifactId}-${project.version}.jar</file>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<webXml>
						${basedir}/src/main/webapp/WEB-INF/web.xml
					</webXml>
					<warName>http_proxy</warName>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.eclipse.jetty.ee10</groupId>
				<artifactId>jetty-ee10-maven-plugin</artifactId>
				<version>12.1.10</version>
			</plugin>

			<!-- versioning -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>3.3.1</version>
				<configuration>
				  <tagNameFormat>v@{project.version}</tagNameFormat>
				</configuration>
			</plugin>

		</plugins>
		<extensions>
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ssh</artifactId>
				<version>3.5.3</version>
			</extension>
		</extensions>
	</build>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<log4j-version>2.25.4</log4j-version>
		<httpclient5-version>5.6.1</httpclient5-version>
		<jetty-version>12.1.10</jetty-version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-core</artifactId>
				<version>${log4j-version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-api</artifactId>
				<version>${log4j-version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-slf4j2-impl</artifactId>
				<version>${log4j-version}</version>
			</dependency>
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter</artifactId>
				<version>5.11.4</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-fileupload2-jakarta-servlet6</artifactId>
				<version>2.0.0-M5</version>
			</dependency>

			<dependency>
				<groupId>org.apache.httpcomponents.client5</groupId>
				<artifactId>httpclient5</artifactId>
				<version>${httpclient5-version}</version>
			</dependency>

			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>2.22.0</version>
			</dependency>

			<dependency>
				<groupId>commons-codec</groupId>
				<artifactId>commons-codec</artifactId>
				<version>1.22.0</version>
			</dependency>

			<dependency>
				<groupId>jakarta.servlet</groupId>
				<artifactId>jakarta.servlet-api</artifactId>
				<version>6.0.0</version>
				<scope>provided</scope>
			</dependency>

			<dependency>
				<groupId>org.eclipse.jetty.ee10</groupId>
				<artifactId>jetty-ee10-webapp</artifactId>
				<version>${jetty-version}</version>
			</dependency>

			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>5.23.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-junit-jupiter</artifactId>
				<version>5.23.0</version>
				<scope>test</scope>
			</dependency>

			<dependency>
				<groupId>org.wiremock</groupId>
				<artifactId>wiremock-standalone</artifactId>
				<version>3.10.0</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<!-- JUnit 5 dependencies -->
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Log4j2 dependencies -->
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j2-impl</artifactId>
		</dependency>

		<!-- Commons -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-fileupload2-jakarta-servlet6</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.httpcomponents.client5</groupId>
			<artifactId>httpclient5</artifactId>
		</dependency>

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>

        <dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
		</dependency>

		<dependency>
			<groupId>jakarta.servlet</groupId>
			<artifactId>jakarta.servlet-api</artifactId>
		</dependency>

		<!-- Embedded Jetty -->
		<dependency>
			<groupId>org.eclipse.jetty.ee10</groupId>
			<artifactId>jetty-ee10-webapp</artifactId>
		</dependency>

		<!-- Test dependencies -->
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.wiremock</groupId>
			<artifactId>wiremock-standalone</artifactId>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<profiles>
		<profile>
			<id>docker</id>
			<dependencies>
				<dependency>
					<groupId>jakarta.servlet</groupId>
					<artifactId>jakarta.servlet-api</artifactId>
					<version>6.0.0</version>
					<scope>compile</scope>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>3.8.0</version>
						<configuration>
							<archive>
								<manifest>
									<mainClass>it.geosolutions.httpproxy.Main</mainClass>
								</manifest>
							</archive>
							<descriptors>
								<descriptor>src/main/assembly/fat-jar.xml</descriptor>
							</descriptors>
							<finalName>http-proxy</finalName>
							<appendAssemblyId>false</appendAssemblyId>
						</configuration>
						<executions>
							<execution>
								<id>make-assembly</id>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>owasp</id>
			<activation>
				<property>
					<name>owasp</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.owasp</groupId>
						<artifactId>dependency-check-maven</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<repositories>

        <!-- central is assumed -->

		<repository>
			<releases>
				<enabled>true</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<id>osgeo</id>
			<name>OSGeo Nexus Release Repository</name>
			<url>https://repo.osgeo.org/repository/release/</url>
		</repository>

	</repositories>

</project>
