<?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>dbtoolkit</artifactId>
    <packaging>jar</packaging>
    <version>${version.number}</version>
    <name>dbtoolkit</name>
    <url>http://code.google.com/p/dbtoolkit/</url>

    <!-- Set the version number for the whole project -->
    <properties>
        <version.number>4.1.3</version.number>
    </properties>

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

    <!-- Developers -->
    <developers>
        <developer>
            <name>Lennart Martens</name>
            <id>lennart</id>
            <email>lennart.martens@UGent.be</email>
            <organization>Computational Omics and Systems Biology Group, VIB Department of Medical Protein Research, UGent, Belgium</organization>
        </developer>
    </developers>

    <!-- Build -->
    <build>
        <!-- Copy the resources required during building -->
        <resources>
            <resource>
                <directory>src/main/resources/</directory>
                <includes>
                    <include>test.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.dbtoolkit.gui.DBTool</mainClass>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib</classpathPrefix>
                        </manifest>
                    </archive>
                    <outputDirectory>${project.build.directory}/dbtoolkit-${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}/dbtoolkit-${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>
                                </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>
                                </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>

        </plugins>
    </build>

    <!-- Repositores -->
    <!-- Repositores -->
    <repositories>
        <!-- UGent Genesis Maven 1 repository -->
        <repository>
            <id>genesis-maven-repository</id>
            <name>Genesis 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>
            <scope>build</scope>
        </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.27</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>
