<?xml version="1.0" encoding="UTF-8"?>
<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.qubit.solution.fenixedu.build</groupId>
		<artifactId>qub-fenixedu-project</artifactId>
		<version>2.2.2</version>
	</parent>

	<groupId>org.fenixedu</groupId>
	<artifactId>fenixedu-treasury-base</artifactId>
	<version>15.8.6</version>
	<packaging>jar</packaging>

	<name>Treasury</name>

	<properties>
		<version.jackson>2.18.3</version.jackson>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.qubit.solution.fenixedu</groupId>
				<artifactId>fenixedu-oss-dependency-management</artifactId>
				<version>689</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>
			<dependency>
				<groupId>com.sun.xml.ws</groupId>
				<artifactId>jaxws-ri</artifactId>
				<version>2.3.0</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>
			<dependency>
				<groupId>com.sun.xml.ws</groupId>
				<artifactId>jaxws-rt</artifactId>
				<version>2.3.1</version>
				<scope>import</scope>
				<type>pom</type>
			</dependency>
		</dependencies>
	</dependencyManagement>


	<dependencies>
		<dependency>
			<groupId>com.qubit.terra</groupId>
			<artifactId>qub-foundation-core-api</artifactId>
		</dependency>
		<dependency>
			<groupId>pt.ist</groupId>
			<artifactId>standards</artifactId>
		</dependency>
		<dependency>
			<groupId>org.fenixedu</groupId>
			<artifactId>bennu-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.qubit.solution.fenixedu</groupId>
			<artifactId>bennu-webservices-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.fenixedu</groupId>
			<artifactId>bennu-renderers</artifactId>
		</dependency>
		<dependency>
			<groupId>org.fenixedu</groupId>
			<artifactId>bennu-scheduler</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.6</version>
		</dependency>
		<dependency>
			<groupId>org.fenixedu</groupId>
			<artifactId>fenixedu-commons</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-beanutils</groupId>
			<artifactId>commons-beanutils</artifactId>
			<version>1.9.4</version>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<version>1.15</version>
		</dependency>
		<dependency>
			<groupId>eu.europa.ec.taxud</groupId>
			<artifactId>tin-algorithm</artifactId>
			<version>5.2.2_PUBLIC</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.ws</groupId>
			<artifactId>jaxws-rt</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.xml.ws</groupId>
			<artifactId>jaxws-api</artifactId>
			<version>2.3.1</version>
		</dependency>
		<dependency>
			<groupId>com.paypal.sdk</groupId>
			<artifactId>checkout-sdk</artifactId>
			<version>1.0.5</version>
		</dependency>

		<!-- From online-payments-gateway -->
		<dependency>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-common</artifactId>
			<version>2.38</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${version.jackson}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>${version.jackson}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<version>${version.jackson}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-joda</artifactId>
			<version>${version.jackson}</version>
		</dependency>

	</dependencies>


	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jaxb2-maven-plugin</artifactId>
				<version>2.5.0</version>
				<executions>
					<execution>
						<id>xjc-singap-siag</id>
						<goals>
							<goal>xjc</goal>
						</goals>
						<configuration>
							<forceRegenerate>true</forceRegenerate>
							<packageName>org.fenixedu.treasury.generated.sources.saft.singap.siag</packageName>
							<outputDirectory>${basedir}/target/generated-sources/xsd/singap_siag</outputDirectory>
							<sources>
								<source>${basedir}/src/main/xsd/saft/FenixEdu_ERP_Integration_1.0.4.xsd</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>xjc-sap</id>
						<goals>
							<goal>xjc</goal>
						</goals>
						<configuration>
							<forceRegenerate>true</forceRegenerate>
							<packageName>org.fenixedu.treasury.generated.sources.saft.sap</packageName>
							<outputDirectory>${basedir}/target/generated-sources/xsd/sap</outputDirectory>
							<sources>
								<source>${basedir}/src/main/xsd/saft/FenixEdu_ERP_Integration_1.0.5.xsd</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>xjc-modelo46</id>
						<goals>
							<goal>xjc</goal>
						</goals>
						<configuration>
							<forceRegenerate>true</forceRegenerate>
							<packageName>org.fenixedu.treasury.generated.sources.modelo46</packageName>
							<outputDirectory>${basedir}/target/generated-sources/xsd/modelo46</outputDirectory>
							<sources>
								<source>${basedir}/src/main/xsd/modelo46/Modelo46.xsd</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${basedir}/target/generated-sources/xsd/</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>


			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.2.1</version>
				<executions>
					<execution>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<executable>maven</executable>
					<arguments></arguments>
				</configuration>
			</plugin>
			<!-- Dependency needed because we cannot be a child of 2 parent projects 
				(versioning and webservices) -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>jaxws-maven-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>SIAG</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>wsimport</goal>
						</goals>
						<configuration>
							<packageName>org.fenixedu.treasury.services.integration.erp.siag</packageName>

							<!-- <wsdlDirectory> -->
							<!-- src/main/webapp/wsdl -->
							<!-- </wsdlDirectory> -->
							<wsdlFiles>
								<wsdlFile>
									${basedir}/src/main/resources/wsdl/SIAGGestaoAcademicaService.wsdl
								</wsdlFile>
							</wsdlFiles>
							<wsdlLocation>
								/wsdl/SIAGGestaoAcademicaService.wsdl
							</wsdlLocation>
							<vmArgs>
								<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
							</vmArgs>
						</configuration>

					</execution>
					<execution>
						<id>SINGAP</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>wsimport</goal>
						</goals>
						<configuration>
							<packageName>org.fenixedu.treasury.services.integration.erp.singap</packageName>

							<!-- <wsdlDirectory> -->
							<!-- src/main/webapp/wsdl -->
							<!-- </wsdlDirectory> -->
							<wsdlFiles>
								<wsdlFile>
									${basedir}/src/main/resources/wsdl/Fenix_Singap_v2.0.wsdl
								</wsdlFile>
							</wsdlFiles>
							<wsdlLocation>
								/wsdl/Fenix_Singap_v2.0.wsdl
							</wsdlLocation>
							<vmArgs>
								<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
							</vmArgs>
						</configuration>

					</execution>
					<execution>
						<id>SINGAP_WCF</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>wsimport</goal>
						</goals>
						<configuration>
							<packageName>org.fenixedu.treasury.services.integration.erp.singapWCF</packageName>

							<!-- <wsdlDirectory> -->
							<!-- src/main/webapp/wsdl -->
							<!-- </wsdlDirectory> -->
							<wsdlFiles>
								<wsdlFile>
									${basedir}/src/main/resources/wsdl/WCFGenio.WSF.WCFServiceWSF-1.0.0-15092015.svc.wsdl
								</wsdlFile>
							</wsdlFiles>
							<wsdlLocation>
								/wsdl/WCFGenio.WSF.WCFServiceWSF-1.0.0-15092015.svc.wsdl
							</wsdlLocation>
							<extension>true</extension>
							<protocol>Xsoap1.2</protocol>
							<vmArgs>
								<vmArg>-Djavax.xml.accessExternalSchema=all </vmArg>
							</vmArgs>
						</configuration>

					</execution>
					<execution>
						<id>SAP</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>wsimport</goal>
						</goals>
						<configuration>
							<packageName>org.fenixedu.treasury.services.integration.erp.sap</packageName>

							<!-- <wsdlDirectory> -->
							<!-- src/main/webapp/wsdl -->
							<!-- </wsdlDirectory> -->
							<wsdlFiles>
								<wsdlFile>
									${basedir}/src/main/resources/wsdl/zulws_faturacaoclientes_blk_2017_01_17.xml
								</wsdlFile>
							</wsdlFiles>
							<wsdlLocation>
								/wsdl/zulws_faturacaoclientes_blk_2017_01_17.xml
							</wsdlLocation>
							<extension>true</extension>
							<protocol>Xsoap1.2</protocol>
							<vmArgs>
								<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
							</vmArgs>
						</configuration>
					</execution>
					<execution>
						<id>PAYLINE</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>wsimport</goal>
						</goals>
						<configuration>
							<packageName>org.fenixedu.treasury.services.integration.forwardpayments.payline</packageName>
							<wsdlFiles>
								<wsdlFile>
									${basedir}/src/main/resources/wsdl/forwardpayments/payline/WebPaymentAPI_V4.wsdl
								</wsdlFile>
							</wsdlFiles>
							<wsdlLocation>
								/wsdl/forwardpayments/payline/WebPaymentAPI_V4.wsdl
							</wsdlLocation>
							<extension>true</extension>
							<protocol>Xsoap1.2</protocol>
							<vmArgs>
								<vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
							</vmArgs>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/endorsed</outputDirectory>
							<silent>true</silent>
							<artifactItems>
								<artifactItem>
									<groupId>javax.xml.bind</groupId>
									<artifactId>jaxb-api</artifactId>
									<version>2.2.7</version>
									<type>jar</type>
								</artifactItem>
								<artifactItem>
									<groupId>javax.xml.ws</groupId>
									<artifactId>jaxws-api</artifactId>
									<version>2.2.9</version>
									<type>jar</type>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<id>initialize</id>
						<phase>initialize</phase>
						<configuration>
							<target>
								<property name="basedir" refid="maven.project" />

								<echo message="ANTRUN: copy resources and convert to UTF-8 to webapp/WEB-INF/resources" />

								<copy todir="${basedir}/src/main/webapp/WEB-INF/resources" encoding="ISO-8859-15" outputencoding="UTF-8" overwrite="true">
									<fileset dir="${basedir}/src/main/resources/resources/" />
								</copy>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
