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

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>
 
    <groupId>org.datanucleus</groupId>
    <artifactId>datanucleus-maven-parent</artifactId>
    <version>3.3</version>
    <packaging>pom</packaging>

    <name>DataNucleus Maven parent project</name>
    <description>
        Provides common configuration for DataNucleus projects.
    </description>
 
    <url>http://www.datanucleus.org</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:datanucleus/${project.artifactId}.git</connection>
        <developerConnection>scm:git:git@github.com:datanucleus/${project.artifactId}.git</developerConnection>
        <url>https://github.com/datanucleus/${project.artifactId}</url>
    </scm>

    <developers>
        <developer>
            <id>andy</id>
            <name>Andy</name>
            <organization>DataNucleus</organization>
        </developer>
    </developers>

    <properties>
        <encoding>UTF-8</encoding>
        <maven.compiler.source>1.6</maven.compiler.source>
        <maven.compiler.target>1.6</maven.compiler.target>
    </properties>

    <build>
        <sourceDirectory>src/java</sourceDirectory>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/java</directory>
                <includes>
                    <include>**/plugin.xml</include>
                    <include>**/*.properties</include>
                    <include>**/*.dtd</include>
                    <include>**/*.xsd</include>
                    <include>**/*.jdo</include>
                    <include>**/META-INF/services/*</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}</directory>
                <includes>
                    <include>plugin.xml</include>
                    <include>schema/*</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/META-INF</directory>
                <targetPath>META-INF</targetPath>
                <includes>
                    <include>*LICENSE*.txt</include>
                    <include>NOTICE.txt</include>
                    <include>README.txt</include>
                </includes>
            </resource>
        </resources>

        <testSourceDirectory>src/test</testSourceDirectory>
        <testResources>
            <testResource>
                <directory>${basedir}/src/test</directory>
                <includes>
                    <include>**/persistence*.xml</include>
                    <include>**/plugin*.xml</include>
                    <include>**/*.jdo*</include>
                    <include>**/*.orm*</include>
                    <include>**/*.xsd</include>
                    <include>**/*.jdoquery*</include>
                    <include>**/*.MF</include>
                    <include>log4j.properties</include>
                </includes>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.7</version>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>*.log</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.10</version>
                <configuration>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.4.0</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <!-- Need to have MANIFEST.MF in place before packaging, 
                            so unit-tests will work -->
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <!-- 2.4 has an issue with m2e see -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=406507 -->
                <version>2.3.2</version>
                <configuration>
                    <!-- Pick the MANIFEST generated by the bundle plugin -->
                    <archive>  
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive> 
                </configuration>
            </plugin>  
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>2.3.1</version>
            </plugin>
        </plugins>

        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>2.2</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-enforcer-plugin</artifactId>
                                        <versionRange>[1.0.0,)</versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <!-- Test dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <!-- For any artifacts that aren't present in Maven Central -->
        <repository>
            <id>DN_M2_Repo</id>
            <url>http://www.datanucleus.org/downloads/maven2/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <distributionManagement>
        <!-- For nightly build process -->
        <snapshotRepository>
            <id>datanucleus-nightly</id>
            <name>DataNucleus Nightly</name>
            <url>file:${user.home}/htdocs/downloads/maven2-nightly/</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>
</project>
