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

  <!-- Needed to make deployment work -->
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>

	<prerequisites>
    <maven>3.0</maven>
  </prerequisites>



  <packaging>pom</packaging>

  <groupId>org.overturetool</groupId>
  <artifactId>root</artifactId>

  <version>2.6.0</version>

  <name>The Overture Tool Platform root</name>
  <description>
    Overture is a community-based project developing the next generation of open-source tools to support modelling and analysis in the design of computer-based systems. Overture supports VDM: The Vienna Development Method, a set of modelling techniques with a long and successful history of industrial application and research. Overture is an integrated development environment (IDE) for developing VDM models. The Overture tools are written entirely in Java and build on top of the Eclipse platform. Overture supports the VDM-SL, VDM++, and VDM-RT language dialects.
  </description>

  <modules>
    <module>externals</module>
    <module>core</module>
		<module>documentation</module>
    <!-- <module>tools</module> -->
    <!-- The ide module is Tycho and the -PWith-IDE profile. -->
    <!-- <module>ide</module> -->
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>With-IDE</id>
      <modules>
        <module>ide</module>
      </modules>
    </profile>

		
		<profile>
      <id>codesigning</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jarsigner-plugin</artifactId>
            <configuration>
							
							<!-- This is an attempt to disable the test error: java.lang.SecurityException: class ...'s signer information does not match signer information of other classes in the same package
							-->
							<removeExistingSignatures>true</removeExistingSignatures>
              
							<storetype>${keystore.type}</storetype>
              <keystore>${keystore.path}</keystore>
              <alias>${keystore.alias}</alias>
              <storepass>${keystore.store.password}</storepass>
              <keypass>${keystore.key.password}</keypass>
            </configuration>
            <executions>
              <execution>
                <id>sign</id>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>


  </profiles>

  <build>
    <defaultGoal>install</defaultGoal>

    <plugins>
      <plugin>
        <!--
            This plugin allows you to run

$ mvn versions:set -Dtycho.mode=maven -PWith-IDE -DnewVersion=2.0.4

and get all the version numbers updated nearly for free.
The tycho bit on the end just tells tycho (used in the
eclipse plugin build) to piss off.

Note that the versions in MANIFEST.MF files, etc, still
need to be set.

More details on the versions-maven-plugin are at
http://mojo.codehaus.org/versions-maven-plugin/
        -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <configuration>
          <!-- Version control obviates the need for this. -->
          <generateBackupPoms>false</generateBackupPoms>
        </configuration>
      </plugin>

			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.7.6.201602180812</version>

				<configuration>
					<destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
					<dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
					<!-- Exclude the overture AST -->
					<excludes>
						<exclude>**/org/overture/ast/analysis/**/*.*</exclude>
						<exclude>**/org/overture/ast/expressions/**/*.*</exclude>
						<exclude>**/org/overture/ast/modules/**/*.*</exclude>
						<exclude>**/org/overture/ast/node/**/*.*</exclude>
						<exclude>**/org/overture/ast/patterns/**/*.*</exclude>
						<exclude>**/org/overture/ast/statements/**/*.*</exclude>
						<exclude>**/org/overture/ast/types/**/*.*</exclude>

						<!-- ir AST -->
						<exclude>**/org/overture/codegen/ir/**/*</exclude>

						<!-- Overture IDE - it has currently no tests -->
						<exclude>**/org/overture/ide/**/*</exclude>

						
					</excludes>
				</configuration>
				<executions>
					<execution>
						<id>jacoco-initialize</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>jacoco-site</id>
						<phase>package</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
    </plugins>

    <!-- Configuration of plugins for inheriting pom.xml files should
         be in the pluginManagement tag
    -->
    <pluginManagement>
      <plugins>
        <!-- Configure the compiler for all Overture Projects -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.5.1</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>
        </plugin>

        <!-- Attatch sources to all installed jars -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.0</version>
          <!-- <executions> -->
          <!--   <execution> -->
          <!--     <id>attach-sources</id> -->
          <!--     <goals> -->
          <!--       <goal>jar</goal> -->
          <!--     </goals> -->
          <!--   </execution> -->
          <!-- </executions> -->
          <configuration>
            <attach>true</attach>
          </configuration>
        </plugin>

        <!-- Enable JavaDoc but dont fail on error. This must be disabled for
             the Eclipse project in the IDE -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.3</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <failOnError>false</failOnError>
            <quiet>true</quiet>
          </configuration>
        </plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.4</version>
				</plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.19.1</version>
        </plugin>



        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.10</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>2.6</version>
          <configuration>
            <descriptorRefs>
              <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>2.4.3</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.6</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
        </plugin>

				<plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>2.8.1</version>
        </plugin>

			  <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jarsigner-plugin</artifactId>
          <version>1.2</version>
        </plugin>
				

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.10</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.2</version>
        </plugin>

        <plugin>
          <groupId>pl.project13.maven</groupId>
          <artifactId>git-commit-id-plugin</artifactId>
          <version>2.2.0</version>
          <configuration>
            <!--dotGitDirectory>${project.basedir}/.git</dotGitDirectory this is not wokring, set in build section instead -->
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
          <configuration>
						<releaseProfiles>release,With-IDE,all-platforms,codesigning</releaseProfiles>
            <tagNameFormat>Release/@{project.version}</tagNameFormat>
          </configuration>
        </plugin>


				<!-- Disable the maven enforcer warning in Eclipse -->
				<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,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

				<!-- Plugin for license headers-->
				<plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>1.8</version>
					<configuration>
						<verbose>true</verbose>
						<addSvnKeyWords>false</addSvnKeyWords>
						<processEndTag>#~%</processEndTag>
						<processStartTag>#%~</processStartTag>
						<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
						<!--descriptionTemplate>${basedir}/src/license/myDescriptionTemplate.ftl</descriptionTemplate-->
            <licenseName>gpl_v3</licenseName>
            <roots>
              <root>src/main/java</root>
              <root>src/test/java</root>
            </roots>

						<includes>
              <include>**/*.java</include>
            </includes>
						<excludes>
              <exclude>*.ftl</exclude>

            </excludes>
					</configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh</artifactId>
        <version>2.4</version>
      </extension>
    </extensions>
  </build>

  <scm>
    <url>git@github.com:overturetool/overture.git</url>
    <connection>scm:git:git://github.com/overturetool/overture.git</connection>
    <developerConnection>scm:git:git@github.com:overturetool/overture.git</developerConnection>
    <tag>Release/2.6.0</tag>
  </scm>

  <developers>
    <developer>
      <id>overture</id>
      <email>info@overturetool.org</email>
      <name>Information contact for the Overture project</name>
      <url>http://overturetool.org/</url>
      <roles>
        <role>Primary point of contact</role>
      </roles>
    </developer>
    <developer>
      <id>lausdahl</id>
      <email>lausdahl@eng.au.dk</email>
      <name>Kenneth Lausdahl</name>
      <roles>
        <role>coordinator</role>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <organization>Aarhus University</organization>
      <organizationUrl>http://eng.au.dk/</organizationUrl>
    </developer>
    <developer>
      <id>nickbattle</id>
      <email>nick.battle@gmail.com</email>
      <name>Nick Battle</name>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
      <organization>Fujitsu UK</organization>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>GNU General Public License (GPL) version 3</name>
      <url>http://www.gnu.org/licenses/gpl.txt</url>
    </license>
  </licenses>

  <organization>
    <name>Overture</name>
    <url>http://overturetool.org/</url>
  </organization>

  <inceptionYear>2008</inceptionYear>
</project>
