<?xml version="1.0"?>
<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>
    <groupId>com.compomics</groupId>
    <artifactId>mascotdatfile</artifactId>
    <packaging>jar</packaging>
    <version>${version.number}</version>
    <name>mascotdatfile</name>
    <url>http://mascotdatfile.googlecode.com</url>

    <!-- Set the version number for the whole project -->
    <properties>
        <version.number>3.2.4</version.number>
        <logging.file.path.name>mascotdatfile_log4j.log</logging.file.path.name>
        <logging.file.max.size>5000KB</logging.file.max.size>
        <logging.pattern>[%d{dd-MMM-yyyy HH:mm:ss} - %p] "%m" (%C:%L)%n</logging.pattern>
        <logging.level.default>INFO</logging.level.default>
    </properties>

    <!-- Licence -->
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>

            <url>LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <!-- Build -->
    <build>
        <!-- Copy the resources required during building -->
        <resources>
            <resource>
                <directory>src/main/resources/</directory>
                <includes>
                    <include>modificationConversion.txt</include>
                </includes>
            </resource>
        </resources>


        <!-- Plugins -->
        <plugins>
            <!-- Compiler plugin -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                    <showDeprecation>true</showDeprecation>
                    <debug>true</debug>
                </configuration>
            </plugin>

            <!-- Jar plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>
                                com.compomics.mascotdatfile.research.tool.spectrumviewer.spectrumviewer_gui.Spectrumviewer_gui
                            </mainClass>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib</classpathPrefix>
                        </manifest>
                    </archive>
                    <outputDirectory>${project.build.directory}/mascotdatfile-${project.version}</outputDirectory>
                </configuration>
            </plugin>

            <!-- Dependency plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/mascotdatfile-${project.version}/lib
                            </outputDirectory>
                            <overWriteReleases>true</overWriteReleases>
                            <overWriteSnapshots>true</overWriteSnapshots>
                            <excludeTransitive>false</excludeTransitive>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Resources plugin -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.3</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/classes
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources/</directory>
                                    <includes>
                                        <include>log4j.properties</include>
                                        <include>modificationConversion.txt</include>
                                    </includes>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-package-license</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}</directory>
                                    <includes>
                                        <include>LICENSE-2.0.txt</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Resources plugin -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.3</version>
                <!-- Copy resources into appropriate folder upon packaging -->
                <executions>
                    <!-- Copy main resources into test classpath when running the tests -->
                    <execution>
                        <id>copy-test-resources</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <overwrite>true</overwrite>
                            <outputDirectory>src/test/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Create javadoc on build -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.6.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Pack sources on build -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.1.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- JUnit tests plugin (SureFire plugin) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>pertest</forkMode>
                    <!-- This is the parameter that matters: max memory needs to be high! -->
                    <argLine>-Xmx512m</argLine>
                    <testFailureIgnore>false</testFailureIgnore>
                    <skip>false</skip>
                </configuration>
            </plugin>

            <!-- Assembly plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.2-beta-5</version>
                <configuration>
                    <descriptors>
                        <descriptor>src/main/assembly/zip.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <!-- this is used for inheritance merges -->
                        <phase>package</phase>
                        <!-- append to the packaging phase. -->
                        <goals>
                            <goal>single</goal>
                            <!-- goals == mojos -->
                        </goals>
                    </execution>
                </executions>
            </plugin>


        </plugins>
    </build>

    <!-- Repositores -->
    <repositories>
        <!-- UGent Genesis Maven 1 repository -->
        <repository>
            <id>genesis-maven-repository</id>
            <name>Genesis maven repository</name>
            <url>http://genesis.UGent.be/maven</url>
            <layout>legacy</layout>
        </repository>

        <!-- UGent Genesis Maven 2 repository -->
        <repository>
            <id>genesis-maven2-repository</id>
            <name>Genesis maven2 repository</name>
            <url>http://genesis.UGent.be/maven2</url>
            <layout>default</layout>
        </repository>

    </repositories>


    <!-- Dependencies -->
    <dependencies>
        <!-- This project depends on the junit JAR file.
        -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
        </dependency>
        <!-- This project depends on the JAR file "lmjunit-1.0.2.jar" (TestCaseLM)
           the remote repository root of which is 'http://genesis.UGent.be/maven'.
        -->
        <dependency>
            <groupId>lennart</groupId>
            <artifactId>lmjunit</artifactId>
            <version>1.0.2</version>
            <type>jar</type>
        </dependency>

        <!-- This project depends on the utilities JAR file.
        -->
        <dependency>
            <groupId>com.compomics</groupId>
            <artifactId>utilities</artifactId>
            <version>3.0.7</version>
            <type>jar</type>
        </dependency>

        <!-- This project depends on the iText pdf library for pdf output.
        -->
        <dependency>
            <groupId>itext</groupId>
            <artifactId>iText</artifactId>
            <version>2.0.8</version>
            <type>jar</type>
        </dependency>


        <!-- This project depends on the commons-io JAR file.
        -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.1</version>
            <type>jar</type>
        </dependency>

        <!-- This project depends on the commons-logging JAR file.
        -->
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1</version>
            <type>jar</type>
        </dependency>

        <!-- This project depends on the xxindex JAR file.
        -->
        <dependency>
            <groupId>lennart</groupId>
            <artifactId>cpdetector</artifactId>
            <version>1.0.4</version>
            <type>jar</type>
        </dependency>

        <!-- This project depends on the xxindex JAR file.
        -->
        <dependency>
            <groupId>lennart</groupId>
            <artifactId>xxindex</artifactId>
            <version>0.5</version>
            <type>jar</type>
        </dependency>
    </dependencies>

    <!-- The deployment maven2 repository-->
    <distributionManagement>
        <repository>
            <id>genesis-maven2-repo</id>
            <name>Genesis Maven Repository</name>
            <url>scp://genesis.ugent.be/home/maven/public_html/maven2</url>
        </repository>
    </distributionManagement>


</project>
