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

    <artifactId>interfaces-ext</artifactId>
    <packaging>${packaging.type}</packaging>
    <name>interfaces-ext</name>
    <url>http://aksw.org/Projects/DLLearner</url>
    <description>Interfaces: CLI for external components</description>
        
        
    <parent>
        <groupId>org.dllearner</groupId>
        <artifactId>dllearner-parent</artifactId>
        <version>1.5.0</version>
    </parent>
    
    <properties>
        <dist-dir>dl-learner-dist</dist-dir>
        <install-dir>share/dl-learner</install-dir>
        <packaging.type>jar</packaging.type>
    </properties>
        
        
        
    <dependencies>
        
        <dependency>
            <groupId>org.dllearner</groupId>
            <artifactId>interfaces</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>jena</artifactId>
                    <groupId>com.hp.hpl.jena</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>stanford-corenlp</artifactId>
                    <groupId>edu.stanford.nlp</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>slf4j-ext</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        
<!--        <dependency>
            <groupId>unife</groupId>
            <artifactId>bundle</artifactId>
            <version>2.1-SNAPSHOT</version>
            <type>jar</type>
        </dependency>-->
        
        <dependency>
            <groupId>org.dllearner</groupId>
            <artifactId>components-ext</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>component-core</artifactId>
                    <groupId>org.dllearner</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        
        <dependency>
            <groupId>openMPI</groupId>
            <artifactId>openmpi-java-binding</artifactId>
            <version>1.8.6</version>
            <type>jar</type>
        </dependency>
        <!--       <dependency>
            <groupId>org.dllearner</groupId>
            <artifactId>interfaces</artifactId>
            <version>1.3-SNAPSHOT</version>
            <type>jar</type>
        </dependency>
        -->
        
    </dependencies>
    
     
    <profiles>
	<profile>
		<id>win</id>
		<activation>
			<os><family>windows</family></os>
		</activation>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<configuration>
						<excludes>
							<exclude>org/dllearner/cli/unife/CLILEAP*</exclude>
						</excludes>
					</configuration>
				</plugin>
			</plugins>
		</build>
	</profile>
        <profile>
            <id>jetty</id>
            <properties>
                <packaging.type>war</packaging.type>
            </properties>
            <build>
                <plugins>
                    <!-- <plugin> <groupId>org.simplericity.jettyconsole</groupId> <artifactId>jetty-console-maven-plugin</artifactId> 
                    <version>1.50</version> <executions> <execution> <goals> <goal>createconsole</goal> 
                    </goals> <configuration> <backgroundImage>${basedir}/src/main/resources/dl.gif</backgroundImage> 
                    <additionalDependencies> <additionalDependency> <artifactId>jetty-console-log4j-plugin</artifactId> 
                    </additionalDependency> </additionalDependencies> </configuration> </execution> 
                    </executions> </plugin> -->
                    <plugin>
                        <groupId>org.apache.tomcat.maven</groupId>
                        <artifactId>tomcat7-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>tomcat-run</id>
                                <goals>
                                    <goal>exec-war-only</goal>
                                </goals>
                                <phase>package</phase>
                                <configuration>
                                    <path>/interfaces-ext</path>
                                    <enableNaming>false</enableNaming>
                                    <finalName>dl-learner-standalone.jar</finalName>
                                    <charset>utf-8</charset>
                                    <extraDependencies>
                                        <!--
                                            <dependency>
                                                    <groupId>org.slf4j</groupId>
                                                    <artifactId>slf4j-api</artifactId>
                                                    <version>${slf4j.version}</version>
                                            </dependency>
                                            <dependency>
                                                    <groupId>org.slf4j</groupId>
                                                    <artifactId>jul-to-slf4j</artifactId>
                                                    <version>${slf4j.version}</version>
                                            </dependency>
                                            <dependency>
                                                    <groupId>org.slf4j</groupId>
                                                    <artifactId>slf4j-log4j12</artifactId>
                                                    <version>${slf4j.version}</version>
                                            </dependency>
                                            <dependency>
                                                    <groupId>log4j</groupId>
                                                    <artifactId>log4j</artifactId>
                                                    <version>${log4j.version}</version>
                                            </dependency>
                                        -->
                                    </extraDependencies>
                                    <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>org.codehaus.mojo</groupId>
                        <artifactId>appassembler-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>assemble</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <repositoryLayout>flat</repositoryLayout>
                            <useWildcardClassPath>true</useWildcardClassPath>
                            <assembleDirectory>${project.build.directory}/dl-learner-dist</assembleDirectory>
                            <repoPath>lib</repoPath>
                            <repositoryName>lib</repositoryName>
                            <!-- <defaultJvmSettings>
                                    <initialMemorySize>512M</initialMemorySize>
                            <maxMemorySize>1024M</maxMemorySize>
                            <extraArguments>
                            <extraArgument>-Dlog4j.configuration=../conf/log4j.properties</extraArgument>
                            </extraArguments>
                            </defaultJvmSettings> -->
                            <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 -Xmx3g -Dlog4j.configuration=file:@BASEDIR@/etc/log4j.properties
                            </extraJvmArguments>
							
                            <installArtifacts>false</installArtifacts>
                            <!-- <configurationDirectory>/</configurationDirectory> -->
                            <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.unife.CLILEAP</mainClass>
                                    <name>clileap</name>
                                </program>
                                <program>
                                    <mainClass>org.dllearner.cli.Enrichment</mainClass>
                                    <name>enrichment</name>
                                </program>
                                <program>
                                    <mainClass>org.dllearner.cli.SemKernelCLI</mainClass>
                                    <name>semkernel</name>
                                </program>
                                <!-- <program> <mainClass>org.dllearner.gui.StartGUI</mainClass> 
                                <name>gui</name> </program> <program> <mainClass>org.dllearner.cli.QuickStart</mainClass> 
                                <name>quickstart</name> </program> <program> <mainClass>org.dllearner.server.DLLearnerWS</mainClass> 
                                <name>ws</name> </program> -->
                            </programs>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <finalName>dllearner-ext-${project.version}</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assemble/archive.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>de.akquinet.jbosscc.latex</groupId>
                        <artifactId>maven-latex-plugin</artifactId>
                        <version>1.2</version>
                        <configuration>
                            <settings>
                                <!-- all tex main documents in this folder (including subfolders) 
                                will be processed -->
                                <texDirectory>${basedir}/doc/manual</texDirectory>
                                <!-- the generated artifacts will be copied to this folder relative 
                                to ${project.reporting.outputDirectory} -->
                                <outputDirectory>.</outputDirectory>
                                <!-- the working directory, for temporary files and LaTeX processing -->
                                <tempDirectory>${project.build.directory}/m2latex</tempDirectory>
                                <!-- clean up the working directory in the end? May be used for debugging -->
                                <cleanUp>true</cleanUp>
                                <!-- path to the TeX scripts, if none, it must be on the system path -->
                                <texPath />
                                <!-- the latex command -->
                                <texCommand>pdflatex</texCommand>
                                <!-- the bibtex command -->
                                <bibtexCommand>bibtex</bibtexCommand>
                                <!-- the arguments to use when calling latex -->
                                <texCommandArgs>
                                    <texCommandArg>-interaction=nonstopmode</texCommandArg>
                                    <texCommandArg>--src-specials</texCommandArg>
                                </texCommandArgs>
                            </settings>
                        </configuration>
                        <executions>
                            <!-- execute latex goal automatically during the site phase -->
                            <execution>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>latex</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!--  <plugin>
                      <groupId>org.codehaus.mojo</groupId>
                      <artifactId>latex-maven-plugin</artifactId>
                      <version>1.1</version>
                      <configuration>
                      <docsRoot>${basedir}/doc/manual/</docsRoot>
                      <latexBuildDir>/tmp/latex</latexBuildDir>
                      </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>
                        <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 -Xmx2g -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>
                                <!-- <program> <mainClass>org.dllearner.gui.StartGUI</mainClass> 
                                <name>gui</name> </program> <program> <mainClass>org.dllearner.cli.QuickStart</mainClass> 
                                <name>quickstart</name> </program> <program> <mainClass>org.dllearner.server.DLLearnerWS</mainClass> 
                                <name>ws</name> </program> -->
                            </programs>
                        </configuration>
                    </plugin>
                    <!-- <plugin>
                            <groupId>de.akquinet.jbosscc.latex</groupId>
                            <artifactId>maven-latex-plugin</artifactId>
                            <version>1.2</version>
                            <configuration>
                                    <settings>
                                            all tex main documents in this folder (including subfolders) 
                                                    will be processed
                                            <texDirectory>${basedir}/doc/manual</texDirectory>
                                            the generated artifacts will be copied to this folder relative 
                                                    to ${project.reporting.outputDirectory}
                                            <outputDirectory>.</outputDirectory>
                                            the working directory, for temporary files and LaTeX processing
                                            <tempDirectory>${project.build.directory}/m2latex</tempDirectory>
                                            clean up the working directory in the end? May be used for debugging
                                            <cleanUp>true</cleanUp>
                                            path to the TeX scripts, if none, it must be on the system path
                                            <texPath />
                                            the latex command
                                            <texCommand>pdflatex</texCommand>
                                            the bibtex command
                                            <bibtexCommand>bibtex</bibtexCommand>
                                            the arguments to use when calling latex
                                            <texCommandArgs>
                                                    <texCommandArg>-interaction=nonstopmode</texCommandArg>
                                                    <texCommandArg>src-specials</texCommandArg>
                                            </texCommandArgs>
                                    </settings>
                            </configuration>
                            <executions>
                                    execute latex goal automatically during the site phase
                                    <execution>
                                            <phase>prepare-package</phase>
                                            <goals>
                                                    <goal>latex</goal>
                                            </goals>
                                    </execution>
                            </executions>
                    </plugin> -->
                    <plugin>
                        <artifactId>jdeb</artifactId>
                        <groupId>org.vafer</groupId>
                        <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.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>1.6</version>
                    <executions>
                            <execution>
                                    <phase>package</phase>
                                    <goals>
                                            <goal>shade</goal>
                                    </goals>
                                    <configuration>
                                            <transformers>
                                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                                            <mainClass>org.dllearner.cli.CLI</mainClass>
                                                    </transformer>
                                            </transformers>
                                    </configuration>
                            </execution>
                    </executions>
            </plugin>-->
            <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>
                    <javaSource>${compiler.version}</javaSource>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-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.codehaus.mojo</groupId>
                <artifactId>latex-maven-plugin</artifactId>
                <version>1.1</version>
                <configuration>
                    <docsRoot>${basedir}/doc/manual/</docsRoot>
                    <latexBuildDir>/tmp/latex</latexBuildDir>
                </configuration>
            </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>
                <!--execution is used for testing -->
                <!--executions> <execution> <id>start-jetty</id> <phase>pre-integration-test</phase> 
                <goals> <goal>run</goal> </goals> <configuration> <scanIntervalSeconds>0</scanIntervalSeconds> 
                <daemon>true</daemon> <stopKey>stopKey</stopKey> <stopPort>9999</stopPort> 
                </configuration> </execution> <execution> <id>stop-jetty</id> <phase>post-integration-test</phase> 
                <goals> <goal>stop</goal> </goals> </execution> </executions -->
            </plugin>

            <!--Surefire - for JUnits -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>-Dlog4j.configuration=log4j.properties</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <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>

       
         
</project>
