<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.cibseven</groupId>
		<artifactId>release-parent</artifactId>
		<version>1.4.0</version>
	</parent>

	<groupId>org.cibseven.webapp</groupId>
	<artifactId>cibseven-webclient</artifactId>
 	<version>2.2.0</version>
	<packaging>pom</packaging>

	<name>CIB seven webclient</name>
	<description>CIB seven WebClient is a modern web-based interface for managing and interacting with the CIB seven cloud platform, 
		providing seamless access to services and optimized workflows.</description>

	<properties>
		<target.path>${project.basedir}/target</target.path>
		<project.git.url>https://github.com/cibseven/cibseven-webclient.git</project.git.url>
		<nexus-repository.url>https://artifacts.cibseven.org</nexus-repository.url>

		<maven.compiler.source>17</maven.compiler.source>
		<maven.compiler.target>17</maven.compiler.target>
		<maven-war-plugin.version>3.5.0</maven-war-plugin.version>
		<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
		<maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
		<maven-enforcer-plugin.version>3.6.2</maven-enforcer-plugin.version>
		<jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>

		<git-commit-id-maven-plugin.version>9.0.2</git-commit-id-maven-plugin.version>

		<jjwt.version>0.12.6</jjwt.version>
		<commons-io.version>2.18.0</commons-io.version>
		<common-auth.version>1.3.0</common-auth.version>
		<!-- ============================================================================
		     Spring Boot 3 — default flavour (cibseven-webclient-web, -core, direct-provider).
		     ============================================================================ -->
		<version.spring.boot>3.5.14</version.spring.boot>
		<version.openapi-starter-webmvc-ui>2.8.13</version.openapi-starter-webmvc-ui>

		<!-- ============================================================================
		     Spring Boot 4 flavour (cibseven-webclient-web-sb4). The "4" / SB4-specific
		     suffix marks versions that diverge from the SB3 default above. Naming mirrors
		     cibseven-parent (~/cibseven/cibseven/parent/pom.xml) so these can be consolidated
		     there later: version.spring-boot4, version.tomcat (11.x) vs version.tomcat10.
		     ============================================================================ -->
		<version.spring.boot4>4.0.6</version.spring.boot4>
		<version.openapi-starter-webmvc-ui4>3.0.2</version.openapi-starter-webmvc-ui4>
		<!-- SB4 no longer bundles Jackson 2, but the shared core compiles against
		     com.fasterxml.jackson.* (Jackson 2); the SB4 module pulls it back in explicitly. -->
		<version.jackson2>2.21.2</version.jackson2>

		<!-- ============================================================================
		     CVE overrides. This project imports spring-boot-dependencies as a BOM (not as the
		     parent), so the usual ${tomcat.version}/${postgresql.version} BOM-property overrides
		     do NOT take effect — the fixed versions are pinned via explicit dependencyManagement
		     entries below.
		     ============================================================================ -->
		<!-- Apache Tomcat: CVE-2026-41293, -43512, -43515, -41284, -43513, -42498, -43514.
		     SB3 runs the Tomcat 10.1.x line (fixed in 10.1.55), SB4 the 11.0.x line (fixed in 11.0.22).
		     Suffix mirrors cibseven-parent: version.tomcat = 11.x (SB4), version.tomcat10 = 10.x (SB3). -->
		<version.tomcat10>10.1.55</version.tomcat10>
		<version.tomcat>11.0.22</version.tomcat>
		<!-- swagger-ui webjar (via springdoc, both flavours): bundles DOMPurify 3.4.0 ->
		     CVE-2026-41240, -0540, CVE-2025-15599, CVE-2026-41238, -41239 and related GHSAs. -->
		<version.swagger-ui>5.32.6</version.swagger-ui>
		<version.commons-lang3>3.18.0</version.commons-lang3>
		
		<image.tomcat-11-base>harbor.cib.de/dev/tomcat-11-base:0.1.0@sha256:49e9bd250b4bc4e33465195106831b1afa69d38c0147f9960075cb1b45a8f7f5</image.tomcat-11-base>
		<jib-maven-plugin.version>3.5.1</jib-maven-plugin.version>
		<jib.from.image>${image.tomcat-11-base}</jib.from.image>
		<jib.to.image>harbor.cib.de/dev/cibseven-webclient:${project.version}</jib.to.image>

		<version.eirslett.frontend.maven.plugin>1.15.4</version.eirslett.frontend.maven.plugin>
		<version.nodejs>24.13.1</version.nodejs>
		<version.npm>11.8.0</version.npm>

		<version.log4j2>2.25.4</version.log4j2>

		<!-- Database driver versions (used by modeler JPA integration) -->
		<version.postgresql>42.7.11</version.postgresql>
		<version.mariadb>3.5.7</version.mariadb>
		<version.h2>2.4.240</version.h2>
		<version.mysql>9.5.0</version.mysql>
		<version.oracle>23.26.0.0.0</version.oracle>
		<version.mssql>12.8.2.jre11</version.mssql>
		<version.db2>11.5.9.0</version.db2>

		<!-- NPM publish tag configuration - empty by default (uses 'latest'), can be overridden with tag dev -->
		<npm.publish.tag.arg></npm.publish.tag.arg>

		<!-- REWRITE COPYRIGHT PARAMEMER FROM SUPER POM (CAMUNDA COPYRIGHT) -->
		<license.inlineHeader>Copyright CIB software GmbH and/or licensed to CIB software GmbH
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information regarding copyright
ownership. CIB software licenses this file to you under the Apache License,
Version 2.0; you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.</license.inlineHeader>

	</properties>

	<profiles>
		<profile>
			<id>normal-build</id>
			<activation>
				<property>
					<name>!release-npm-library</name>
				</property>
			</activation>
			<modules>
				<module>cibseven-interfaces</module>
				<module>cibseven-webclient-web</module>
				<module>cibseven-webclient-core</module>
				<module>cibseven-direct-provider</module>
				<module>cibseven-webclient-web-sb4</module>
			</modules>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-clean-plugin</artifactId>
						<inherited>false</inherited>
						<configuration>
							<filesets>
								<fileset>
									<directory>./frontend/target</directory>
								</fileset>
							</filesets>
						</configuration>
					</plugin>
					<plugin>
						<groupId>com.github.eirslett</groupId>
						<artifactId>frontend-maven-plugin</artifactId>
						<version>${version.eirslett.frontend.maven.plugin}</version>
						<inherited>false</inherited>
						<configuration>
							<nodeVersion>v${version.nodejs}</nodeVersion>
							<npmVersion>${version.npm}</npmVersion>
							<workingDirectory>./frontend</workingDirectory>
							<outputdir>${project.build.directory}/webapp</outputdir>
							<skip>${skip.frontend.build}</skip>
						</configuration>
						<executions>
							<execution>
								<id>install node and npm</id>
								<goals>
									<goal>install-node-and-npm</goal>
								</goals>
							</execution>
							<execution>
								<id>npm ci</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>ci --no-audit --no-fund</arguments>
								</configuration>
							</execution>
							<!--
							<execution>
								<id>License check</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>run license-check</arguments>
								</configuration>
							</execution>
							-->
							<execution>
								<id>Test</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>run test:report</arguments>
									<skip>${skipTests}</skip>
								</configuration>
							</execution>
							<execution>
								<id>Lint</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>run lint</arguments>
									<skip>${skipTests}</skip>
								</configuration>
							</execution>
							<execution>
								<id>Build</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>run build</arguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>release-npm-library</id>
			<activation>
				<property>
					<name>release-npm-library</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-clean-plugin</artifactId>
						<inherited>false</inherited>
						<configuration>
							<filesets>
								<fileset>
									<directory>./frontend/target</directory>
								</fileset>
							</filesets>
						</configuration>
					</plugin>
					<plugin>
						<groupId>com.github.eirslett</groupId>
						<artifactId>frontend-maven-plugin</artifactId>
						<version>${version.eirslett.frontend.maven.plugin}</version>
						<inherited>false</inherited>
						<configuration>
							<nodeVersion>v${version.nodejs}</nodeVersion>
							<npmVersion>${version.npm}</npmVersion>
							<workingDirectory>${release-npm-library}</workingDirectory>
							<outputdir>${project.build.directory}/webapp</outputdir>
							<skip>${skip.frontend.build}</skip>
						</configuration>
						<executions>
							<execution>
								<id>install node and npm</id>
								<goals>
									<goal>install-node-and-npm</goal>
								</goals>
							</execution>
							<execution>
								<id>npm ci</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>ci --no-audit --no-fund</arguments>
								</configuration>
							</execution>
							<execution>
								<id>npm version</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>version --allow-same-version
										--no-git-tag-version ${project.version}</arguments>
									<skip>${skip.npm.version.update}</skip>
								</configuration>
							</execution>
							<execution>
								<id>Build</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>run build:library</arguments>
								</configuration>
							</execution>
							<execution>
								<id>npm publish</id>
								<goals>
									<goal>npm</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<arguments>publish${npm.publish.tag.arg}</arguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
			<profile>
				<id>add-missing-copyright</id>
				<build>
					<plugins>
						<plugin>
							<groupId>com.mycila</groupId>
							<artifactId>license-maven-plugin</artifactId>
							<version>5.0.0</version>
							<configuration>
								<mapping>
									<vue>XML_STYLE</vue>
								</mapping>
								<licenseSets>
									<licenseSet>
										<inlineHeader>${license.inlineHeader}</inlineHeader>
										<includes>
											<include>**/*.java</include>
											<include>**/*.js</include> 
											<include>**/*.vue</include>
										</includes>
									</licenseSet>
								</licenseSets>
							</configuration>
						</plugin>
					</plugins>
				</build>
			</profile>
	</profiles>

	<dependencyManagement>
		<dependencies>
		
			<dependency>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-dependencies</artifactId>
				<scope>import</scope>
				<type>pom</type>
				<version>${version.spring.boot}</version>
			</dependency>
		
			<!-- Override log4j versions to fix security vulnerabilities -->
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-api</artifactId>
				<version>${version.log4j2}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-core</artifactId>
				<version>${version.log4j2}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-slf4j-impl</artifactId>
				<version>${version.log4j2}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-to-slf4j</artifactId>
				<version>${version.log4j2}</version>
			</dependency>

			<!-- Override Apache Tomcat for the SB3 flavour (BOM pins the vulnerable 10.1.54) to fix
			     CVE-2026-41293, -43512, -43515, -41284, -43513, -42498, -43514 (fixed in 10.1.55).
			     The SB4 module overrides these to ${version.tomcat} (11.0.22) in its own pom. -->
			<dependency>
				<groupId>org.apache.tomcat.embed</groupId>
				<artifactId>tomcat-embed-core</artifactId>
				<version>${version.tomcat10}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat.embed</groupId>
				<artifactId>tomcat-embed-el</artifactId>
				<version>${version.tomcat10}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat.embed</groupId>
				<artifactId>tomcat-embed-websocket</artifactId>
				<version>${version.tomcat10}</version>
			</dependency>

			<!-- Override pgjdbc (managed by the Spring Boot BOM at 42.7.10) to fix
			     CVE-2026-42198 (fixed in 42.7.11) -->
			<dependency>
				<groupId>org.postgresql</groupId>
				<artifactId>postgresql</artifactId>
				<version>${version.postgresql}</version>
			</dependency>

			<!-- Override the swagger-ui webjar pulled transitively by springdoc to ship
			     DOMPurify 3.4.0 (CVE-2026-41240, -0540, CVE-2025-15599, CVE-2026-41238, -41239 + GHSAs) -->
			<dependency>
				<groupId>org.webjars</groupId>
				<artifactId>swagger-ui</artifactId>
				<version>${version.swagger-ui}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>${maven-enforcer-plugin.version}</version>
				<executions>
					<execution>
						<id>enforce-dependency-convergence</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<DependencyConvergence />
							</rules>
							<fail>true</fail>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<inherited>false</inherited>
				<configuration>
					<filesets>
						<fileset>
							<directory>./frontend/target</directory>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler-plugin.version}</version>
				<configuration>
					<source>${maven.compiler.source}</source>
					<target>${maven.compiler.target}</target>
					<release>${maven.compiler.target}</release>
					<compilerArgs>
						<arg>-parameters</arg>
						<arg>-Werror</arg>
					</compilerArgs>
				</configuration>
			</plugin>	
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<failOnError>false</failOnError>
					<doclint>none</doclint>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco-maven-plugin.version}</version>
				<executions>
					<execution>
						<id>jacoco-prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>jacoco-report</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.google.cloud.tools</groupId>
					<artifactId>jib-maven-plugin</artifactId>
					<version>${jib-maven-plugin.version}</version>
					<configuration>
						<skip>true</skip>
						<from>
							<image>${jib.from.image}</image>
						</from>
						<to>
							<image>${jib.to.image}</image>
						</to>
						<!-- https://github.com/GoogleContainerTools/jib/blob/master/jib-maven-plugin/README.md#extended-usage -->
						<container>
							<labels>
								<!-- https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys -->
								<org.opencontainers.image.vendor>CIB software GmbH</org.opencontainers.image.vendor>
								<org.opencontainers.image.authors>CIB software GmbH</org.opencontainers.image.authors>
								<org.opencontainers.image.licenses>Proprietary software by CIB software GmbH</org.opencontainers.image.licenses>
								<org.opencontainers.image.title>${project.name}</org.opencontainers.image.title>
								<org.opencontainers.image.version>${project.version}</org.opencontainers.image.version>
								<org.opencontainers.image.ref.name>${jib.to.image}</org.opencontainers.image.ref.name>
								<org.opencontainers.image.description>${project.description}</org.opencontainers.image.description>
								<org.opencontainers.image.source>${project.git.url}</org.opencontainers.image.source>
								<org.opencontainers.image.url>${project.git.url}</org.opencontainers.image.url>
								<org.opencontainers.image.base.name>${jib.from.image}</org.opencontainers.image.base.name>
							</labels>
						</container>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<repositories>
		<repository>
			<id>mvn-group</id>
			<name>Maven group</name>
			<!-- Links to repos for local builds by community users on master branch,
			for local builds by developers on maintainance branches, jboss and maven central -->
			<url>https://artifacts.cibseven.org/repository/mvn-group</url>
		</repository>
	</repositories>

	<scm>
		<connection>scm:git:${project.git.url}</connection>
		<developerConnection>scm:git:${project.git.url}</developerConnection>
		<url>${project.git.url}</url>
		<tag>HEAD</tag>
	</scm>

</project>
