<?xml version="1.0"?>
<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>com.suncode</groupId>
		<artifactId>plusworkflow</artifactId>
		<version>4.4.0-RC5</version>
	</parent>

	<artifactId>plusworkflow-web</artifactId>
	<packaging>war</packaging>

	<dependencies>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-internal</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-old-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-i18n</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-audit</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-form-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-form-web</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>cuf-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>cuf-web</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-upgrader</artifactId>
		</dependency>

		<dependency>
			<groupId>com.suncode.plugin</groupId>
			<artifactId>plugin-framework-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode.plugin</groupId>
			<artifactId>plugin-framework-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.suncode.plugin</groupId>
			<artifactId>plugin-framework-web</artifactId>
		</dependency>

		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>xpdl-parser</artifactId>
		</dependency>

		<dependency>
			<groupId>jakarta.servlet</groupId>
			<artifactId>jakarta.servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.servlet.jsp</groupId>
			<artifactId>jakarta.servlet.jsp-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.servlet.jsp.jstl</groupId>
			<artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.websocket</groupId>
			<artifactId>jakarta.websocket-client-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>jakarta.websocket</groupId>
			<artifactId>jakarta.websocket-api</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet.jsp</groupId>
			<artifactId>javax.servlet.jsp-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>jstl</groupId>
			<artifactId>jstl</artifactId>
		</dependency>

		<dependency>
			<groupId>jakarta.persistence</groupId>
			<artifactId>jakarta.persistence-api</artifactId>
		</dependency>

		<dependency>
			<groupId>org.json</groupId>
			<artifactId>json</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.code.gson</groupId>
			<artifactId>gson</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-hibernate5</artifactId>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core-jakarta</artifactId>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-validator</artifactId>
		</dependency>

		<dependency>
			<groupId>com.plusmpm</groupId>
			<artifactId>displaytag</artifactId>
		</dependency>
		<dependency>
			<groupId>com.github.librepdf</groupId>
			<artifactId>openpdf</artifactId>
		</dependency>
		<dependency>
			<groupId>com.plusmpm</groupId>
			<artifactId>displaytag-export-poi</artifactId>
		</dependency>
		<dependency>
			<groupId>com.plusmpm</groupId>
			<artifactId>displaytag-portlet</artifactId>
		</dependency>

		<dependency>
			<groupId>xml-apis</groupId>
			<artifactId>xml-apis</artifactId>
		</dependency>

		<!-- JAXB runtimes (javax, jakarta) -->
		<dependency>
			<groupId>org.glassfish.jaxb</groupId>
			<artifactId>jaxb-runtime</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<scope>runtime</scope>
		</dependency>

		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>ajaxtags</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-catalina</artifactId>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>struts</groupId>
			<artifactId>struts</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.suncode.org.apache.struts</groupId>
			<artifactId>struts-tiles</artifactId>
		</dependency>
		<dependency>
			<groupId>struts</groupId>
			<artifactId>struts-jakarta-migrated</artifactId>
			<scope>runtime</scope>
			<exclusions>
				<exclusion>
					<groupId>commons-fileupload</groupId>
					<artifactId>commons-fileupload</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>commons-httpclient</groupId>
			<artifactId>commons-httpclient</artifactId>
		</dependency>

		<dependency>
			<groupId>ro.isdc.wro4j</groupId>
			<artifactId>wro4j-core</artifactId>
		</dependency>
		<dependency>
			<groupId>gg.jte</groupId>
			<artifactId>jte</artifactId>
		</dependency>

		<dependency>
			<groupId>javax.sql</groupId>
			<artifactId>jdbc-stdext</artifactId>
		</dependency>

		<!-- JXL -->
		<dependency>
			<groupId>net.sourceforge.jexcelapi</groupId>
			<artifactId>jxl</artifactId>
			<exclusions>
				<exclusion>
					<groupId>log4j</groupId>
					<artifactId>log4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- Apache Lucene -->
		<dependency>
			<groupId>org.apache.lucene</groupId>
			<artifactId>lucene-core</artifactId>
		</dependency>

		<!-- JFreeChart -->
		<dependency>
			<groupId>org.jfree</groupId>
			<artifactId>jfreechart</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jfree</groupId>
			<artifactId>jcommon</artifactId>
		</dependency>

		<!-- Java Advanced Imaging -->
		<dependency>
			<groupId>javax.media</groupId>
			<artifactId>jai-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.media</groupId>
			<artifactId>jai-codec</artifactId>
		</dependency>

		<!-- Spring framework -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.ws</groupId>
			<artifactId>spring-ws-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.security</groupId>
			<artifactId>spring-security-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-websocket</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-messaging</artifactId>
		</dependency>

		<!-- Apache commons -->
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-text</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-digester</groupId>
			<artifactId>commons-digester</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents.client5</groupId>
			<artifactId>httpclient5</artifactId>
		</dependency>

		<!-- JAX RPC -->
		<dependency>
			<groupId>javax.xml</groupId>
			<artifactId>jaxrpc-api</artifactId>
		</dependency>

		<dependency>
			<groupId>com.sun</groupId>
			<artifactId>pdf-view</artifactId>
		</dependency>
		<dependency>
		    <groupId>org.apache.pdfbox</groupId>
		    <artifactId>jbig2-imageio</artifactId>
		</dependency>
		<dependency>
			<groupId>org.fontbox</groupId>
			<artifactId>fontbox</artifactId>
		</dependency>
		<dependency>
			<groupId>org.jempbox</groupId>
			<artifactId>jempbox</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-scratchpad</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml-full</artifactId>
		</dependency>
		<dependency>
			<groupId>org.docx4j</groupId>
			<artifactId>docx4j-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.docx4j</groupId>
			<artifactId>docx4j-JAXB-ReferenceImpl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.docx4j</groupId>
			<artifactId>docx4j-export-fo</artifactId>
		</dependency>

		<!-- Apache PDFBox -->
		<dependency>
			<groupId>org.apache.pdfbox</groupId>
			<artifactId>pdfbox</artifactId>
		</dependency>

		<dependency>
			<groupId>net.htmlparser.jericho</groupId>
			<artifactId>jericho-html</artifactId>
		</dependency>

		<!-- SHARK -->
		<dependency>
			<groupId>org.enhydra</groupId>
			<artifactId>shark</artifactId>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>org.apache.xmlgraphics</groupId>
			<artifactId>batik-js</artifactId>
		</dependency>

		<dependency>
			<groupId>eu.bitwalker</groupId>
			<artifactId>UserAgentUtils</artifactId>
		</dependency>

		<!-- TEST -->
		<dependency>
			<groupId>com.suncode</groupId>
			<artifactId>plusworkflow-form-web</artifactId>
			<classifier>classes</classifier>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<version>9.1-901-1.jdbc4</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>io.swagger</groupId>
			<artifactId>swagger-annotations</artifactId>
			<version>1.6.15</version>
		</dependency>

		<dependency>
			<groupId>com.github.java-json-tools</groupId>
			<artifactId>json-patch</artifactId>
			<version>1.13</version>
			<exclusions>
				<exclusion>
					<groupId>com.google.code.findbugs</groupId>
					<artifactId>jsr305</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.jboss.aerogear</groupId>
			<artifactId>aerogear-otp-java</artifactId>
		</dependency>

		<!-- ZXing for QR code generation -->
		<dependency>
			<groupId>com.google.zxing</groupId>
			<artifactId>core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.zxing</groupId>
			<artifactId>javase</artifactId>
		</dependency>
	</dependencies>

	<build>
		<resources>
			<resource>
				<directory>src/main/java</directory>
				<excludes>
					<exclude>**/*.java</exclude>
				</excludes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<finalName>PlusWorkflow</finalName>
		<plugins>
			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.1.0</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>node</directory>
						</fileset>
						<fileset>
							<directory>node_modules</directory>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>gg.jte</groupId>
				<artifactId>jte-maven-plugin</artifactId>
				<version>${jte.version}</version>
				<configuration>
					<sourceDirectory>${project.basedir}/src/main/webapp/pages</sourceDirectory>
					<targetDirectory/>
					<contentType>Html</contentType>
				</configuration>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.github.eirslett</groupId>
				<artifactId>frontend-maven-plugin</artifactId>
				<configuration>
					<environmentVariables>
						<NODE_OPTIONS>--max_old_space_size=4098</NODE_OPTIONS>
					</environmentVariables>
				</configuration>
				<executions>
					<execution>
						<id>install node and npm</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>install-node-and-npm</goal>
						</goals>
					</execution>
					<execution>
						<id>npm install</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>install --legacy-peer-deps</arguments>
						</configuration>
					</execution>
					<execution>
						<id>npm run jsdoc</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>run jsdoc</arguments>
						</configuration>
					</execution>
					<execution>
						<id>npm run build</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>npm</goal>
						</goals>
						<configuration>
							<arguments>run build</arguments>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<!-- Podczas budowania projektu zostanie utworzony dodatkowy jar: plusworkflow-web-classes.jar -->
					<!-- Plik zawiera klasy - projekt typu war nie może być zależnością -->
					<attachClasses>true</attachClasses>
				</configuration>
				<executions>
					<!--Wyłączenie budowania wara w fazie 'default-war', która jest
					uruchamiana przed fazą 'package', ponieważ przed spakowaniem wara muszą
					się wykonać powyższe pluginy.-->
					<execution>
						<id>default-war</id>
						<phase>none</phase>
						<goals>
							<goal>war</goal>
						</goals>
					</execution>
					<!--War jest pakowany w fazie 'package' po wykonaniu wszystkich powyższych
					pluginów-->
					<execution>
						<id>package-war</id>
						<phase>package</phase>
						<goals>
							<goal>war</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.spotify</groupId>
				<artifactId>dockerfile-maven-plugin</artifactId>
				<version>1.4.13</version>
				<configuration>
					<repository>plusworkflow</repository>
					<tag>${project.version}</tag>
				</configuration>
			</plugin>
			<plugin>
				<groupId>com.github.kongchen</groupId>
				<artifactId>swagger-maven-plugin</artifactId>
				<version>3.1.8</version>
				<configuration>
					<apiSources>
						<apiSource>
							<springmvc>true</springmvc>
							<locations>
								<location>com.suncode.pwfl.web.controller.api.*</location>
								<location>com.suncode.pwfl.web.controller.xpdl.*</location>
							</locations>
							<securityDefinitions>
								<securityDefinition>
									<name>basicAuth</name>
									<type>basic</type>
								</securityDefinition>
							</securityDefinitions>
							<info>
								<title>Plus Workflow REST API</title>
								<version>4.3-SNAPSHOT</version>
								<description>
									Plus Workflow system provides a simple API that allows you to perform basic actions in the system.
								</description>
								<contact>
									<name>
										Contact the developer
									</name>
									<email>
										jjankowiak@suncode.pl
									</email>
								</contact>
								<license>
									<name>Apache 2.0 license</name>
									<url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
								</license>
							</info>
							<externalDocs>
								<description>
									Documentation of the Plus Workflow system
								</description>
								<url>
									https://plusworkflow.helpdocsonline.com/home
								</url>
							</externalDocs>
							<swaggerDirectory>${project.basedir}/src/main/resources/swagger</swaggerDirectory>
							<outputFormats>json</outputFormats>
							<operationIdFormat>{{className}}_{{methodName}}</operationIdFormat>
						</apiSource>
					</apiSources>
				</configuration>
				<executions>
					<execution>
						<phase>compile</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
