<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<name>GATE Core</name>

	<groupId>uk.ac.gate</groupId>
	<artifactId>gate-core</artifactId>
	<version>9.0</version>

	<description>
        GATE - general architecture for text engineering - is open source
        software capable of solving almost any text processing problem.  This
        artifact enables you to embed the core GATE Embedded with its essential
        dependencies.  You will able to use the GATE Embedded API and load and
        store GATE XML documents. This artifact is the perfect dependency for
        CREOLE plugins or for applications that need to customize the GATE
        dependencies due to conflict with their own dependencies or for lower
        footprint.
	</description>
	<url>http://gate.ac.uk/</url>

	<organization>
		<name>GATE</name>
		<url>http://gate.ac.uk</url>
	</organization>

	<developers>
		<developer>
			<id>gate-team</id>
			<name>GATE Team</name>
			<email>gate-developers@lists.sourceforge.net</email>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>GNU Lesser General Public License (LGPL), Version 3</name>
			<url>http://www.gnu.org/licenses/lgpl.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<mailingLists>
		<mailingList>
			<name>GATE Users</name>
			<post>gate-users@groups.io</post>
			<archive>https://groups.io/g/gate-users</archive>
		</mailingList>
	</mailingLists>

	<scm>
		<connection>scm:git:git://github.com/GateNLP/gate-core.git</connection>
		<developerConnection>scm:git:git@github.com:GateNLP/gate-core.git</developerConnection>
		<url>https://github.com/GateNLP/gate-core</url>
	</scm>

	<packaging>jar</packaging>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<tika.version>1.25</tika.version>
		<pdfbox.version>2.0.22</pdfbox.version>
		<jempbox.version>1.8.16</jempbox.version>
		<bouncycastle.version>1.68</bouncycastle.version>
		<poi.version>4.1.2</poi.version>
		<maven.resolver.version>1.6.1</maven.resolver.version>
		<maven.version>3.6.3</maven.version>
		<slf4j.version>1.7.30</slf4j.version>
	</properties>

	<dependencies>
		<!-- things that we repackage under an alternative package name -->
		<dependency>
			<groupId>uk.ac.gate</groupId>
			<artifactId>gate-asm</artifactId>
			<version>9.0</version>
			<scope>compile</scope>
		</dependency>

		<!-- aether and it's dependencies for loading CREOLE plugins via Maven -->
		<dependency>
			<groupId>org.apache.maven.resolver</groupId>
			<artifactId>maven-resolver-impl</artifactId>
			<version>${maven.resolver.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-model-builder</artifactId>
			<version>${maven.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-resolver-provider</artifactId>
			<version>${maven.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.resolver</groupId>
			<artifactId>maven-resolver-connector-basic</artifactId>
			<version>${maven.resolver.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.resolver</groupId>
			<artifactId>maven-resolver-transport-http</artifactId>
			<version>${maven.resolver.version}</version>
			<scope>compile</scope>
			<exclusions>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>jcl-over-slf4j</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.resolver</groupId>
			<artifactId>maven-resolver-transport-file</artifactId>
			<version>${maven.resolver.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.resolver</groupId>
			<artifactId>maven-resolver-transport-wagon</artifactId>
			<version>${maven.resolver.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.resolver</groupId>
			<artifactId>maven-resolver-transport-classpath</artifactId>
			<version>${maven.resolver.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-settings-builder</artifactId>
			<version>${maven.version}</version>
		</dependency>

		<dependency>
			<groupId>org.codehaus.plexus</groupId>
			<artifactId>plexus-container-default</artifactId>
			<version>2.1.0</version>

			<!-- we only need one simple abstract class from this JAR -->
			<exclusions>
				<exclusion>
					<groupId>*</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- used for escaping strings in the Annotation Stack and elsewhere -->
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.11</version>
			<scope>compile</scope>
		</dependency>

		<!-- gate-core no longer need this, but if we remove it we break some plugins.
		     Current solution is to mark it as runtime so it's not exposed directly
		     if someone depends on gate-core. It's inclusion should be considered
		     DEPRECATED and it will be removed in a later version of gate-core -->
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.6</version>
			<scope>runtime</scope>
		</dependency>

		<!-- used to load files into String variables as well as helping to close 
			streams etc. -->
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.8.0</version>
			<scope>compile</scope>
		</dependency>

		<!-- We use SLF4J as the logging framework and allow users to
		     choose the most relevant logging implementation for their
		     use case -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
			<scope>compile</scope>
		</dependency>
		
		<!--  we used to use Log4J directly and so we add the bridge to avoid
		      breaking existing code. Over time we should replace the legacy
		      code and then remove this dependency, or at least change the
		      scope to runtime to avoid breaking plugins which assume it
		      is available via the main GATE classloader.

		      Note that in order to remove this we would need to also remove
		      the gate.Utils.logOnce() method. I did wonder about changing the
		      params to use Object instead of Logger and then access via reflection
		      but that changes the method signature meaning plugins compiled against
		      previous versions can't see the method at all and hence throw a
		      NoSuchMethodError. Basically to fully remove this we need to
		      update all the plugins to use SLF4J instead of Log4J (sigh).
		 -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>log4j-over-slf4j</artifactId>
			<version>${slf4j.version}</version>
			<scope>compile</scope>
		</dependency>
		
		<!-- some of our dependencies use commons-logging, but we exclude those
		     transitive dependencies a) to ensure we are consistent in which version
		     is pulled in, but also so we can use the bridge API to delegate the
		     calls back to SLF4J and hence have proper control over the log messages -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
			<version>${slf4j.version}</version>
			<scope>runtime</scope>
		</dependency>
		
		<!-- used extensively throughout GATE for processing XML files -->
		<dependency>
			<groupId>org.jdom</groupId>
			<artifactId>jdom</artifactId>
			<version>1.1.3</version>
			<scope>compile</scope>
		</dependency>

		<!-- used to parse and load HTML documents into GATE -->
		<dependency>
			<groupId>net.sourceforge.nekohtml</groupId>
			<artifactId>nekohtml</artifactId>
			<!-- if we use a higher version then it brings in a version of
			     Xerces that needs a newer version of the XML APIs than is
			     bundled with Java 8. As we exclude the xml-apis throughout
			     this pom file that means everything breaks. If we move the
			     minimum Java version to 9 then that would include the right
			     XML APIs. -->
			<version>1.9.17</version>
			<scope>compile</scope>
			<exclusions>
				<!-- exclude stuff that is now part of Java -->
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- the actual Tika pased format parsers -->
		<!-- this is horribly messy. Tika has now got so big and covers so many 
			formats that the transitive dependencies are just mad. Specifically it pulls 
			in UIMA, OpenNLP and CoreNLP by default which messes with our support. So 
			the solution is to exclude all it's dependencies and then just add back those 
			for PDF, MS Office and LibreOffice which are the only things we claim to 
			use Tika for -->
		<dependency>
			<groupId>org.apache.tika</groupId>
			<artifactId>tika-parsers</artifactId>
			<version>${tika.version}</version>
			<scope>compile</scope>

			<exclusions>
				<exclusion>
					<groupId>*</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.apache.tika</groupId>
			<artifactId>tika-core</artifactId>
			<version>${tika.version}</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.pdfbox</groupId>
			<artifactId>pdfbox</artifactId>
			<version>${pdfbox.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.pdfbox</groupId>
			<artifactId>pdfbox-tools</artifactId>
			<version>${pdfbox.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-logging</groupId>
					<artifactId>commons-logging</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.apache.pdfbox</groupId>
					<artifactId>pdfbox-debugger</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.pdfbox</groupId>
			<artifactId>jempbox</artifactId>
			<version>${jempbox.version}</version>
		</dependency>
		<!-- TIKA-370: PDFBox declares the Bouncy Castle dependencies as optional, 
			but we prefer to have them always to avoid problems with encrypted PDFs. -->
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcmail-jdk15on</artifactId>
			<version>${bouncycastle.version}</version>
		</dependency>
		<dependency>
			<groupId>org.bouncycastle</groupId>
			<artifactId>bcprov-jdk15on</artifactId>
			<version>${bouncycastle.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>${poi.version}</version>
			<exclusions>
				<exclusion>
					<groupId>commons-codec</groupId>
					<artifactId>commons-codec</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-scratchpad</artifactId>
			<version>${poi.version}</version>
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>${poi.version}</version>
			<exclusions>
				<exclusion>
					<groupId>stax</groupId>
					<artifactId>stax-api</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>com.drewnoakes</groupId>
			<artifactId>metadata-extractor</artifactId>
			<version>2.15.0</version>
		</dependency>
		<!-- this marks the end of the Tika madness -->

		<!-- We use Woodstox instead of the default Sun StAX implementation as 
			it seems to behave better. NOTE: I don't know if this is still the case but 
			it seems safer not to break things! -->
		<dependency>
			<groupId>org.codehaus.woodstox</groupId>
			<artifactId>woodstox-core-lgpl</artifactId>
			<version>4.4.1</version>
			<scope>compile</scope>
			<exclusions>
				<!-- exclude stuff that is part of core Java -->
				<exclusion>
					<groupId>javax.xml.stream</groupId>
					<artifactId>stax-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- ANT is used internally by GATE for some tasks, such as the export 
			for GATECloud.net -->
		<dependency>
			<groupId>org.apache.ant</groupId>
			<artifactId>ant</artifactId>
			<version>1.10.9</version>
			<scope>compile</scope>
		</dependency>

		<!--required for loading and saving .gapp files and by some plugins. we 
			pull in the full XPP3 so we only need XStream's master artifact -->
		<dependency>
			<groupId>com.thoughtworks.xstream</groupId>
			<artifactId>xstream</artifactId>
			<version>1.4.15</version>
			<scope>compile</scope>
			<exclusions>
				<!-- we will pull in the full xpp3 so we don't need these -->
				<exclusion>
					<groupId>xmlpull</groupId>
					<artifactId>xmlpull</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xpp3</groupId>
					<artifactId>xpp3_min</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- XPP3 provides the actual implementation under pinning our use of XStream -->
		<dependency>
			<groupId>xpp3</groupId>
			<artifactId>xpp3</artifactId>
			<version>1.1.4c</version>
			<scope>runtime</scope>
		</dependency>

		<!-- needed by CreoleAnnotationHandler at runtime -->
		<dependency>
			<groupId>jaxen</groupId>
			<artifactId>jaxen</artifactId>
			<version>1.2.0</version>
			<scope>runtime</scope>
			<exclusions>
				<!-- we don't need any of these dependencies -->
				<exclusion>
					<groupId>xml-apis</groupId>
					<artifactId>xml-apis</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xerces</groupId>
					<artifactId>xercesImpl</artifactId>
				</exclusion>
				<exclusion>
					<groupId>xom</groupId>
					<artifactId>xom</artifactId>
				</exclusion>
				<exclusion>
					<groupId>jdom</groupId>
					<artifactId>jdom</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- used to parse command line options passed to the GATE GUI -->
		<dependency>
			<groupId>gnu.getopt</groupId>
			<artifactId>java-getopt</artifactId>
			<version>1.0.13</version>
			<scope>compile</scope>
		</dependency>

		<!-- required for outputting documents as JSON -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>2.12.1</version>
			<scope>compile</scope>
		</dependency>

		<!-- required for the new controller metadata viewer -->
		<dependency>
			<groupId>org.xhtmlrenderer</groupId>
			<artifactId>flying-saucer-core</artifactId>
			<version>9.1.20</version>
			<scope>compile</scope>
		</dependency>

		<!-- Used for comparing XML files during some of the GATE tests -->
		<dependency>
			<groupId>xmlunit</groupId>
			<artifactId>xmlunit</artifactId>
			<version>1.6</version>
			<scope>test</scope>
		</dependency>

		<!-- Used for date parsing and formatting -->
		<dependency>
			<groupId>joda-time</groupId>
			<artifactId>joda-time</artifactId>
			<version>2.10.9</version>
			<scope>compile</scope>
		</dependency>

		<!-- Used for testing GATE -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.13.1</version>
			<scope>test</scope>
		</dependency>

		<!-- Used to cache the default plugins list -->
		<dependency>
			<groupId>org.codehaus.httpcache4j</groupId>
			<artifactId>httpcache4j-core</artifactId>
			<version>5.1.1</version>
		</dependency>
		<dependency>
			<groupId>org.codehaus.httpcache4j.storage</groupId>
			<artifactId>storage-file</artifactId>
			<version>5.1.1</version>
		</dependency>

		<!-- these dependencies should ensure the plugin works properly under Java 
			9 and above where these APIs are no longer availble by default -->
		<dependency>
			<groupId>javax.xml.bind</groupId>
			<artifactId>jaxb-api</artifactId>
			<version>2.3.1</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-core</artifactId>
			<version>2.3.0.1</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>2.3.3</version>
		</dependency>
		<dependency>
			<groupId>javax.activation</groupId>
			<artifactId>javax.activation-api</artifactId>
			<version>1.2.0</version>
		</dependency>

	</dependencies>

	<build>
		
        	
		<plugins>
		<plugin>
        		<groupId>org.apache.maven.plugins</groupId>
        		<artifactId>maven-site-plugin</artifactId>
        		<version>3.8.2</version>
        	</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.5</version>
				<executions>
					<execution>
						<id>default-prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>default-report</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.1.1</version>
				<configuration>
					<!-- in theory we should only need one of these and it would be nice 
						to get rid of them alltogether but that's for another day -->
					<failOnError>false</failOnError>
					<additionalparam>-Xdoclint:none</additionalparam>
				</configuration>
			</plugin>
			<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>
					<shortRevisionLength>7</shortRevisionLength>
				</configuration>
			</plugin>
			<!-- regenerate the gate.classpath file in the distro folder -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-invoker-plugin</artifactId>
				<version>3.2.1</version>
				<executions>
					<execution>
						<phase>install</phase>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<projectsDirectory>.</projectsDirectory>
					<pomIncludes>distro/pom.xml</pomIncludes>
					<goals>compile</goals>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0-M3</version>
				<executions>
					<execution>
						<id>enforce-maven</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3.6.0</version>
								</requireMavenVersion>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>

		<resources>
			<!-- this adds the version number into the right file in the jar -->
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>gate/resources/version.txt</include>
					<include>gate/resources/build.txt</include>
				</includes>
			</resource>

			<!-- copy all the other resources without altering them so we don't accidentally 
				corrupt any binary formats -->
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
				<excludes>
					<exclude>gate/resources/version.txt</exclude>
					<exclude>gate/resources/build.txt</exclude>
				</excludes>
			</resource>
		</resources>
	</build>

	<reporting>
		<plugins>
      		<plugin>
        		<groupId>org.apache.maven.plugins</groupId>
        		<artifactId>maven-site-plugin</artifactId>
        		<version>3.8.2</version>
        	</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>3.0.0-M4</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>3.1.1</version>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>3.0.5</version>
				<configuration>
					<findbugsXmlOutput>true</findbugsXmlOutput>
					<findbugsXmlWithMessages>true</findbugsXmlWithMessages>
					<excludeFilterFile>findbugs-excluded.xml</excludeFilterFile>
					<xmlOutput>true</xmlOutput>
					<effort>Max</effort>
					<threshold>Low</threshold>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.1</version>
				<configuration>
					<excludes>
						<!-- this excludes known GUI code from the code coverage results as 
							we know we aren't testing them so will likely have a 0% coverage -->
						<exclude>**/gui/**</exclude>
						<exclude>**/swing/**</exclude>
						<exclude>**/gate/resources/**</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
					<systemPropertyVariables>
						<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
					</systemPropertyVariables>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.1.1</version>
				<configuration>
					<!-- in theory we should only need one of these and it would be nice 
						to get rid of them alltogether but that's for another day -->
					<failOnError>false</failOnError>
					<additionalparam>-Xdoclint:none</additionalparam>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

	<distributionManagement>
		<repository>
			<id>gate-oss</id>
			<name>Sonatype OSS staging</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
			<layout>default</layout>
		</repository>
		<snapshotRepository>
			<id>gate.snapshots</id>
			<name>GATE Snapshots Repository</name>
			<url>https://repo.gate.ac.uk/content/repositories/snapshots</url>
			<layout>default</layout>
		</snapshotRepository>
	</distributionManagement>

	<profiles>
		<profile>
			<id>gpg-sign</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<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>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
