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

    <groupId>org.epics</groupId>
    <artifactId>epics-parent</artifactId>
    <version>7.0.1</version>
    <packaging>pom</packaging>

    <name>EPICS Core Build</name>
    <url>https://github.com/epics-base/epicsCoreJava</url>
    <description>Parent project for the EPICS Core Libraries.</description>

    <properties>
        <!-- Matching versions of Core modules -->
        <epics-pvdata.version>6.1.1</epics-pvdata.version>
        <epics-ntypes.version>0.3.1</epics-ntypes.version>
        <epics-pvaccess.version>5.1.1</epics-pvaccess.version>
        <epics-pvaclient.version>4.3.1</epics-pvaclient.version>
        <epics-pvdatabase.version>4.3.1</epics-pvdatabase.version>
        <jca.version>2.4.1</jca.version>
        <!-- Versions of examples bundled with Core -->
        
        <!-- Name of javadoc overview page -->
        <mainpage.name>${project.name}</mainpage.name>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <modules>
        <module>pvDataJava</module>
        <module>normativeTypesJava</module>
        <module>pvAccessJava</module>
        <module>pvaClientJava</module>
        <module>pvDatabaseJava</module>
        <module>epics-core</module>
        <module>epics-deploy</module>
    </modules>

    <organization>
        <name>EPICS</name>
        <url>http://www.aps.anl.gov/epics/</url>
    </organization>

    <licenses>
        <license>
            <name>The MIT License</name>
            <url>https://tldrlegal.com/license/mit-license</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/epics-base/epicsCoreJava.git</connection>
        <developerConnection>scm:git:https://github.com/epics-base/epicsCoreJava.git</developerConnection>
        <url>https://github.com/epics-base/epicsCoreJava</url>
        <tag>7.0.1</tag>
    </scm>

    <!-- Project developers (alphabetically) taken from SCM logs -->
    <developers>
        <developer>
            <name>Michael Davidsaver</name>
            <email>mdavidsaver@gmail.com</email>
            <organization>Osprey DCS</organization>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <name>Dave Hickin</name>
            <email>david.hickin@diamond.ac.uk</email>
            <organization>Diamond Light Source</organization>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <name>Marty Kraimer</name>
            <email>mrkraimer@comcast.net</email>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <name>Ralph Lange</name>
            <email>ralph.lange@gmx.de</email>
            <organization>ITER Organization</organization>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <name>Kunal Shroff</name>
            <email>kunalshroff9@gmail.com</email>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <name>Matej Sekoranja</name>
            <email>matej.sekoranja@cosylab.com</email>
            <organization>Cosylab</organization>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
        <developer>
            <name>Gregory White</name>
            <email>greg@slac.stanford.edu</email>
            <organization>SLAC</organization>
            <roles>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <distributionManagement>
        <!-- To be able to deploy, set login/passwd in your m2 settings.xml, <servers> section
        (id values there should match ids below) -->
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <!-- Common depoendencies -->
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- Preset dependency versions for core librraies -->
    <dependencyManagement>
        <dependencies>

            <!-- EPICS Core Libraries -->
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvdata</artifactId>
                <version>${epics-pvdata.version}</version>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvdata</artifactId>
                <version>${epics-pvdata.version}</version>
                <classifier>sources</classifier>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvdata</artifactId>
                <version>${epics-pvdata.version}</version>
                <classifier>javadoc</classifier>
            </dependency>

            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-ntypes</artifactId>
                <version>${epics-ntypes.version}</version>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-ntypes</artifactId>
                <version>${epics-ntypes.version}</version>
                <classifier>sources</classifier>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-ntypes</artifactId>
                <version>${epics-ntypes.version}</version>
                <classifier>javadoc</classifier>
            </dependency>

            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvaccess</artifactId>
                <version>${epics-pvaccess.version}</version>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvaccess</artifactId>
                <version>${epics-pvaccess.version}</version>
                <classifier>sources</classifier>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvaccess</artifactId>
                <version>${epics-pvaccess.version}</version>
                <classifier>javadoc</classifier>
            </dependency>

            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvaclient</artifactId>
                <version>${epics-pvaclient.version}</version>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvaclient</artifactId>
                <version>${epics-pvaclient.version}</version>
                <classifier>sources</classifier>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvaclient</artifactId>
                <version>${epics-pvaclient.version}</version>
                <classifier>javadoc</classifier>
            </dependency>

            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvdatabase</artifactId>
                <version>${epics-pvdatabase.version}</version>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvdatabase</artifactId>
                <version>${epics-pvdatabase.version}</version>
                <classifier>sources</classifier>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>epics-pvdatabase</artifactId>
                <version>${epics-pvdatabase.version}</version>
                <classifier>javadoc</classifier>
            </dependency>

            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>jca</artifactId>
                <version>${jca.version}</version>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>jca</artifactId>
                <version>${jca.version}</version>
                <classifier>sources</classifier>
            </dependency>
            <dependency>
                <groupId>org.epics</groupId>
                <artifactId>jca</artifactId>
                <version>${jca.version}</version>
                <classifier>javadoc</classifier>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <!-- Non-standard source directories -->
        <sourceDirectory>${basedir}/src</sourceDirectory>
        <testSourceDirectory>${basedir}/test</testSourceDirectory>

        <plugins>
            <!-- Includes the OSGi manifest -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>3.3.0</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>    
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <configuration>
                    <archive>  
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive> 
                </configuration>
            </plugin>

            <!-- Set compiler for Java 7 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.0-M1</version>
                <configuration>
                    <overview>documentation/${mainpage.name}.html</overview>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin> 
                <artifactId>maven-deploy-plugin</artifactId> 
                <version>2.8.2</version> 
                <dependencies> 
                    <dependency> 
                        <groupId>org.apache.maven.wagon</groupId> 
                        <artifactId>wagon-ssh</artifactId> 
                        <version>2.8</version> 
                    </dependency> 
                </dependencies> 
            </plugin>

        </plugins>

    </build>

    <profiles>

        <profile> 
            <id>with-examples</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>directoryService</module>
                <module>exampleJava</module>
                <module>bundleJava</module>
            </modules>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>2.5.3</version>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>
