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

	<artifactId>interfaces</artifactId>
	<packaging>${packaging.type}</packaging>
	<name>dllearner-interfaces</name>
	<url>http://aksw.org/Projects/DLLearner</url>
	<description>Interfaces: GUI, CLI, Web Service</description>

	<parent>
		<groupId>org.dllearner</groupId>
		<artifactId>dllearner-parent</artifactId>
		<version>1.3.0</version>
	</parent>

	<properties>
		<dist-dir>dl-learner-dist</dist-dir>
		<install-dir>share/dl-learner</install-dir>
		<packaging.type>jar</packaging.type>
	</properties>

	<profiles>
		<profile>
			<id>jetty</id>
			<properties>
				<packaging.type>war</packaging.type>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.tomcat.maven</groupId>
						<artifactId>tomcat7-maven-plugin</artifactId>
						<version>2.2</version>
						<executions>
							<execution>
								<id>tomcat-run</id>
								<goals>
									<goal>exec-war-only</goal>
								</goals>
								<phase>package</phase>
								<configuration>
									<path>/interfaces</path>
									<enableNaming>false</enableNaming>
									<finalName>dl-learner-standalone.jar</finalName>
									<charset>utf-8</charset>
									<extraResources>
										<extraRexource>
											<directory>${basedir}/src/main/resources/</directory>
											<includes>
												<include>log4j.properties</include>
											</includes>
										</extraRexource>
									</extraResources>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>release</id>
			<properties>
				<packaging.type>jar</packaging.type>
			</properties>
			<build>
				<finalName>interfaces</finalName>
				<plugins>
					<plugin>
						<groupId>com.github.fracpete</groupId>
						<artifactId>latex-maven-plugin</artifactId>
						<version>1.4.2</version>
						<executions>
							<execution>
								<phase>prepare-package</phase>
								<goals>
									<goal>latex</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<forceBuild>true</forceBuild>
							<bibtex>bibtex</bibtex>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>appassembler-maven-plugin</artifactId>
						<version>1.9</version>
						<executions>
							<execution>
								<goals>
									<goal>assemble</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<!-- put dependency JARs to /lib folder -->
							<repositoryLayout>flat</repositoryLayout>
							<!-- shorter classpath which avoid exceptions especially under Windows environment-->
							<useWildcardClassPath>true</useWildcardClassPath>
							<assembleDirectory>${project.build.directory}/dl-learner-dist</assembleDirectory>
							<repositoryName>lib</repositoryName>
							<configurationSourceDirectory>src/main/conf</configurationSourceDirectory>
							<!-- Set the target configuration directory -->
							<configurationDirectory>etc</configurationDirectory>
							<!-- Copy the contents from "/src/main/conf" to the target -->
							<copyConfigurationDirectory>true</copyConfigurationDirectory>
							<!-- Include the target configuration directory in the classpath -->
							<includeConfigurationDirectoryInClasspath>true</includeConfigurationDirectoryInClasspath>
							<extraJvmArguments>
								-Xms256m -Xmx2g -Dlog4j.configuration=file:@BASEDIR@/etc/log4j.properties
							</extraJvmArguments>
							<installArtifacts>false</installArtifacts>
							<platforms>
								<platform>windows</platform>
								<platform>unix</platform>
							</platforms>
							<programs>
								<program>
									<mainClass>org.dllearner.cli.CLI</mainClass>
									<name>cli</name>
								</program>
								<program>
									<mainClass>org.dllearner.cli.Enrichment</mainClass>
									<name>enrichment</name>
								</program>
								<program>
									<mainClass>org.dllearner.cli.SemKernelCLI</mainClass>
									<name>semkernel</name>
								</program>
							</programs>
						</configuration>
					</plugin>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>attached</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<finalName>dllearner-${project.version}</finalName>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptors>
								<descriptor>src/main/assemble/archive.xml</descriptor>
							</descriptors>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>debpackage</id>
			<properties>
				<packaging.type>jar</packaging.type>
			</properties>
			<build>
				<finalName>dl-learner</finalName>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>appassembler-maven-plugin</artifactId>
						<version>1.9</version>
						<executions>
							<execution>
								<goals>
									<goal>assemble</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<repositoryLayout>flat</repositoryLayout>
							<assembleDirectory>${project.build.directory}/${dist-dir}</assembleDirectory>
							<repoPath>/usr/share/dl-learner/lib</repoPath>
							<repositoryName>${install-dir}/lib</repositoryName>
							<extraJvmArguments>-Xms256m -Xmx1024m -Dlog4j.configuration=file:@BASEDIR@/etc/log4j.properties</extraJvmArguments>
							<configurationDirectory>/</configurationDirectory>
							<platforms>
								<platform>unix</platform>
							</platforms>
							<programs>
								<program>
									<mainClass>org.dllearner.cli.CLI</mainClass>
									<name>dl-learner-cli</name>
								</program>
								<program>
									<mainClass>org.dllearner.cli.Enrichment</mainClass>
									<name>dl-learner-enrichment</name>
								</program>
							</programs>
						</configuration>
					</plugin>
					<plugin>
						<artifactId>jdeb</artifactId>
						<groupId>org.vafer</groupId>
						<version>1.3</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>jdeb</goal>
								</goals>
								<configuration>
									<deb>${basedir}/target/dl-learner_[[version]]_all.deb</deb>
									<controlDir>${basedir}/src/debian</controlDir>
									<dataSet>
										<data>
											<src>${project.build.directory}/${dist-dir}/${install-dir}/lib</src>
											<type>directory</type>
											<mapper>
												<type>perm</type>
												<prefix>/usr/share/dl-learner/lib</prefix>
											</mapper>
										</data>
										<data>
											<src>${project.build.directory}/${dist-dir}/bin/dl-learner-cli</src>
											<type>file</type>
											<mapper>
												<type>perm</type>
												<filemode>777</filemode>
												<prefix>/usr/bin</prefix>
											</mapper>
										</data>
										<data>
											<src>${project.build.directory}/${dist-dir}/bin/dl-learner-enrichment</src>
											<type>file</type>
											<mapper>
												<type>perm</type>
												<filemode>777</filemode>
												<prefix>/usr/bin</prefix>
											</mapper>
										</data>
										<data>
											<src>${basedir}/log4j.properties</src>
											<type>file</type>
											<mapper>
												<type>perm</type>
												<filemode>777</filemode>
												<prefix>/usr/share/dl-learner/lib</prefix>
											</mapper>
										</data>
										<data>
											<src>${basedir}/src/debian/interfaces.log</src>
											<type>file</type>
											<mapper>
												<type>perm</type>
												<filemode>777</filemode>
												<prefix>/var/log/dl-learner</prefix>
											</mapper>
										</data>
									</dataSet>
									<changesIn>${basedir}/CHANGES.txt</changesIn>
									<changesOut>${basedir}/target/dl-learner-${project.version}.changes</changesOut>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<finalName>dl-learner</finalName>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>xmlbeans-maven-plugin</artifactId>
				<version>2.3.3</version>
				<executions>
					<execution>
						<goals>
							<goal>xmlbeans</goal>
						</goals>
					</execution>
				</executions>
				<inherited>true</inherited>
				<configuration>
					<schemaDirectory>src/main/xsd</schemaDirectory>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>tomcat-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>javacc-maven-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>javacc</id>
						<goals>
							<goal>javacc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.mortbay.jetty</groupId>
				<artifactId>maven-jetty-plugin</artifactId>
				<configuration>
					<stopKey>stopKey</stopKey>
					<stopPort>9999</stopPort>
					<scanIntervalSeconds>1</scanIntervalSeconds>
					<requestLog implementation="org.mortbay.jetty.NCSARequestLog">
						<filename>log/yyyy_mm_dd.request.log</filename>
						<retainDays>90</retainDays>
						<append>true</append>
						<extended>true</extended>
						<logTimeZone>GMT</logTimeZone>
					</requestLog>
					<connectors>
						<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
							<port>9099</port>
							<maxIdleTime>60000</maxIdleTime>
						</connector>
					</connectors>
				</configuration>
			</plugin>
			<!--Surefire - for JUnits -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>org/dllearner/test/junit/OWLlinkTest.java</exclude>
						<exclude>org/dllearner/configuration/spring/TestBean.java</exclude>
						<exclude>org/dllearner/test/SpringTest.java</exclude>
						<exclude>org/dllearner/test/junit/GeizhalsTest.java</exclude>
						<exclude>org/dllearner/cli/MoosiqueCLITest.java</exclude>
					</excludes>
					<argLine>-Dlog4j.configuration=log4j.properties</argLine>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<version>1.3.2</version>
				<executions>
					<execution>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<executable>java</executable>
					<arguments>
						<argument>-Xms512m</argument>
						<argument>-Xmx4000m</argument>
					</arguments>
				</configuration>
			</plugin>
		</plugins>

		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>xmlbeans-maven-plugin</artifactId>
										<versionRange>[2.3.3,)</versionRange>
										<goals>
											<goal>xmlbeans</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>javacc-maven-plugin</artifactId>
										<versionRange>[2.6,)</versionRange>
										<goals>
											<goal>javacc</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<dependencies>
		<dependency>
			<groupId>org.dllearner</groupId>
			<artifactId>components-core</artifactId>
			<exclusions>
				<exclusion>
					<artifactId>slf4j-ext</artifactId>
					<groupId>org.slf4j</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jsp-api</artifactId>
		</dependency>
		<dependency>
			<groupId>com.googlecode.json-simple</groupId>
			<artifactId>json-simple</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.xmlbeans</groupId>
			<artifactId>xmlbeans</artifactId>
		</dependency>
		<dependency>
			<groupId>net.sf.jopt-simple</groupId>
			<artifactId>jopt-simple</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.3</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-beans</artifactId>
		</dependency>
	</dependencies>

	<reporting>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>javacc-maven-plugin</artifactId>
				<version>2.6</version>
			</plugin>
		</plugins>
	</reporting>
</project>
