<?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>

	<groupId>it.bancaditalia.oss</groupId>
	<artifactId>sdmx</artifactId>
	<version>2.3.4</version>

	<name>SDMX</name>
	<description>Sdmx Connectors for Statistical Software</description>
	<url>https://github.com/amattioc/SDMX/</url>

	<licenses>
		<license>
			<name>European Union Public Licence (EUPL)</name>
			<url>https://joinup.ec.europa.eu/software/page/eupl/licence-eupl</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Attilio Mattiocco</name>
			<email>attilio.mattiocco@bancaditalia.it</email>
			<organization>Banca d'Italia</organization>
			<organizationUrl>http://www.bancaditalia.it/</organizationUrl>
		</developer>
		<developer>
			<name>Valentino Pinna</name>
			<email>valentino.pinna@bancaditalia.it</email>
			<organization>Banca d'Italia</organization>
			<organizationUrl>http://www.bancaditalia.it/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:https://github.com/amattioc/SDMX.git</connection>
		<developerConnection>scm:git:https://github.com/amattioc/SDMX.git</developerConnection>
		<url>https://github.com/amattioc/SDMX/tree/master</url>
	</scm>

	<distributionManagement>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</repository>
	</distributionManagement>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.7</maven.compiler.source>
		<maven.compiler.target>1.7</maven.compiler.target>
		<sdmx.release.description>Autogenerated release description</sdmx.release.description>
	</properties>

	<profiles>
		<!-- Fix missing Java EE Modules in JDK11 -->
		<profile>
			<id>fix-missing-modules-jdk11</id>
			<activation>
				<jdk>[11,)</jdk>
			</activation>
			<dependencies>
				<dependency>
					<groupId>javax.xml.bind</groupId>
					<artifactId>jaxb-api</artifactId>
					<version>2.4.0-b180830.0359</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
		</profile>
            
		<profile>
			<id>compile-stata</id>
			<activation>
				<property>
					<name>sdmx.compile.stata</name>
					<value>true</value>
				</property>
			</activation>
			<dependencies>
				<dependency>
					<groupId>com.stata</groupId>
					<artifactId>stata-sfi</artifactId>
					<version>14.0</version>
				</dependency>
			</dependencies>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<phase>generate-sources</phase>
								<goals>
									<goal>add-source</goal>
								</goals>
								<configuration>
									<sources>
										<source>stata_src</source>
									</sources>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>external</id>
			<activation>
				<property>
					<name>sdmx.external.build</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>single</goal>
								</goals>
								<configuration>
									<attach>false</attach>
									<descriptors>
										<descriptor>${project.build.sourceDirectory}/../assembly/assembly-excel.xml</descriptor>
										<descriptor>${project.build.sourceDirectory}/../assembly/assembly-matlab.xml</descriptor>
										<descriptor>${project.build.sourceDirectory}/../assembly/assembly-sas.xml</descriptor>
										<descriptor>${project.build.sourceDirectory}/../assembly/assembly-stata.xml</descriptor>
									</descriptors>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-dependency-plugin</artifactId>
						<version>3.0.2</version>
						<executions>
							<execution>
								<id>copy-packages</id>
								<phase>verify</phase>
								<goals>
									<goal>copy</goal>
								</goals>
								<configuration>
									<artifactItems>
										<artifactItem>
											<groupId>it.bancaditalia.oss</groupId>
											<artifactId>sdmx</artifactId>
											<version>${project.version}</version>
											<destFileName>SDMX.jar</destFileName>
											<overWrite>true</overWrite>
											<outputDirectory>../RJSDMX/inst/java</outputDirectory>
										</artifactItem>
										<artifactItem>
											<groupId>it.bancaditalia.oss</groupId>
											<artifactId>sdmx</artifactId>
											<version>${project.version}</version>
											<destFileName>SDMX.jar</destFileName>
											<overWrite>true</overWrite>
											<outputDirectory>../STATA/jar</outputDirectory>
										</artifactItem>
									</artifactItems>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-scm-plugin</artifactId>
						<version>1.9.5</version>
						<executions>
							<execution>
								<id>commit-release</id>
								<phase>verify</phase>
								<goals>
									<goal>add</goal>
									<goal>checkin</goal>
									<goal>check-local-modification</goal>
								</goals>
								<configuration>
									<workingDirectory>../</workingDirectory>
									<basedir>../</basedir>
									<includes>/../RJSDMX/inst/java/SDMX.jar,/STATA/jar/SDMX.jar</includes>
									<message>Release v${project.version}</message>
									<pushChanges>false</pushChanges>
								</configuration>
							</execution>
							<execution>
								<id>push-tags</id>
								<phase>deploy</phase>
								<goals>
									<goal>checkin</goal>
									<goal>tag</goal>
								</goals>
								<configuration>
									<workingDirectory>..</workingDirectory>
									<basedir>..</basedir>
									<tag>v${project.version}</tag>
									<message>Version ${project.version}</message>
									<pushChanges>true</pushChanges>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>de.jutzig</groupId>
						<artifactId>github-release-plugin</artifactId>
						<version>1.2.0</version>
						<executions>
							<execution>
								<id>github-release</id>
								<phase>deploy</phase>
								<goals>
									<goal>release</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<releaseName>Release ${project.version}</releaseName>
							<tag>v${project.version}</tag>
							<description>${sdmx.release.description}</description>
							<draft>true</draft>
							<overwriteArtifact>true</overwriteArtifact>
							<fileSets>
								<fileSet>
									<directory>${project.build.directory}</directory>
									<includes>
										<include>${project.artifactId}*.jar</include>
										<include>*.tar.gz</include>
									</includes>
								</fileSet>
							</fileSets>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<version>1.4</version>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<doCheck>false</doCheck>
					<doUpdate>false</doUpdate>
					<revisionOnScmFailure>SNAPSHOT</revisionOnScmFailure>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.0.1</version>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
							<mainClass>it.bancaditalia.oss.sdmx.helper.SDMXHelper</mainClass>
						</manifest>
						<manifestEntries>
							<BUILD>${maven.build.timestamp}</BUILD>
							<Revision>${buildNumber}</Revision>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.0.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.4</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<configuration>
							<additionalparams>-Xdoclint:none</additionalparams>
							<source>1.7</source>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M4</version>
				<configuration>
					<excludes>
                                            <exclude>**/AllTests*</exclude>
                                        </excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>3.0.0-M4</version>
			</plugin>
			<plugin>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.7</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.6</version>
				<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>
				<version>1.6.8</version>
				<extensions>true</extensions>
				<configuration>
					<serverId>ossrh</serverId>
					<nexusUrl>https://oss.sonatype.org/</nexusUrl>
					<autoReleaseAfterClose>true</autoReleaseAfterClose>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
