<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>
	<artifactId>npi</artifactId>
	<groupId>dk.nsi</groupId>
	<packaging>pom</packaging>
	<version>1.1.0</version>
	<name>National Patient Index</name>
    <url>http://nsi.dk</url>

  <modules>
		<module>common</module>
		<module>dgws</module>
		<module>hsuid</module>
		<module>minlog</module>
		<module>consentservices</module>
		<module>npiservices</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<coverage.reports.dir>${basedir}/target/coverage-reports</coverage.reports.dir>
    <sonar.language>java</sonar.language>
		<sonar.jacoco.reportPath>${project.build.directory}/jacoco.exec</sonar.jacoco.reportPath>
		<sonar.jacoco.itReportPath>${project.build.directory}/jacoco-it.exec</sonar.jacoco.itReportPath>
	</properties>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.5.2</version>
        <configuration>
          <formats>
            <format>html</format>
            <format>xml</format>
          </formats>
          <aggregate>true</aggregate>
        </configuration>
      </plugin>
    </plugins>
  </reporting>

	<dependencies>

    <dependency>
      <groupId>net.sourceforge.cobertura</groupId>
      <artifactId>cobertura-runtime</artifactId>
      <version>1.9.4.1</version>
      <scope>provided</scope>
      <type>pom</type>
    </dependency>

		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.6</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.easymock</groupId>
			<artifactId>easymock</artifactId>
			<version>3.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.8.2</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-failsafe-plugin</artifactId>
			<version>2.8.1</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>properties-maven-plugin</artifactId>
			<version>1.0-alpha-2</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>servlet-api</artifactId>
			<version>2.5</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>com.sun.xml.ws</groupId>
			<artifactId>jaxws-tools</artifactId>
			<version>2.1.7</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-entitymanager</artifactId>
			<version>3.6.6.Final</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>javax.ejb</groupId>
			<artifactId>ejb-api</artifactId>
			<version>3.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.16</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<profiles>
		<profile>
			<id>sonar</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
        <sonar.dynamicAnalysis>true</sonar.dynamicAnalysis>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
				<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
				<sonar.modules>common,dgws,hsuid,consentservices,minlog,npiservices</sonar.modules>
        <sonar.exclusions>dk/nsi/fmki20110601/**,dk/medcom/**,dk/oio/**,oasis/**,org/**</sonar.exclusions>
				<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
				<sonar.jdbc.username>sonar</sonar.jdbc.username>
				<sonar.jdbc.password>sonar</sonar.jdbc.password>
				<!-- SERVER AND MYSQL ON A REMOTE HOST - MUST BE DEFINED ON MAVEN COMMAND LINE-->
			</properties>
		</profile>
    <profile>
      <id>cobertura-instrument</id>
      <activation>
        <property>
          <name>cobertura-build</name>
        </property>
      </activation>
      <modules>
        <module>common</module>
        <module>dgws</module>
        <module>hsuid</module>
        <module>minlog</module>
        <module>consentservices</module>
        <module>npiservices</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <configuration>
            </configuration>
            <executions>
              <execution>
                <id>instrument-code</id>
                <phase>process-classes</phase>
                <goals>
                  <goal>instrument</goal>
                </goals>
                <configuration>
                  <attach>true</attach>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
            <inherited>true</inherited>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>net.sourceforge.cobertura</groupId>
          <artifactId>cobertura-runtime</artifactId>
          <version>2.5.2</version>
          <scope>provided</scope>
          <type>pom</type>
        </dependency>
      </dependencies>
    </profile>
  </profiles>

	<build>
		<finalName>${project.artifactId}-${project.version}</finalName>
		<plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.5.2</version>
        <configuration>
          <instrumentation>
            <excludes>
               <exclude>dk/nsi/fmki20110601/**</exclude>
               <exclude>dk/medcom/**</exclude>
               <exclude>dk/oio/**</exclude>
               <exclude>oasis/**</exclude>
               <exclude>org/**</exclude>
               <exclude>ihe/**</exclude>
            </excludes>
          </instrumentation>
          <formats>
            <format>xml</format>
            <format>html</format>
          </formats>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.8</version>
				<configuration>
					<excludePackageNames>dk.medcom.*:dk.nsi.consentservices*:dk.nsi.minlog*:dk.oio.*:oasis.*:org.*</excludePackageNames>
				</configuration>
				<executions>
					<execution>
						<phase>site</phase>
						<goals>
							<goal>javadoc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.9</version>
				<configuration>
					<destFile>${sonar.jacoco.reportPath}</destFile>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.8.1</version>
				<configuration>
					<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
          <destFile>${sonar.jacoco.itReportPath}</destFile>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.6.1.201212231917</version>
				<executions>
					<execution>
						<id>agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.2.1</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.7</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.1.2</version>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>properties-maven-plugin</artifactId>
										<versionRange>[1.0-alpha-2,)</versionRange>
										<goals>
											<goal>read-project-properties</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
				<plugin>
					<groupId>com.google.code.maven-license-plugin</groupId>
					<artifactId>maven-license-plugin</artifactId>
					<configuration>
					   <header>./standardheader.txt</header>
					   <excludes>
						   <exclude>**/target/**</exclude>
						   <exclude>**/.settings/**</exclude>
						   <exclude>**/.project/**</exclude>
						   <exclude>**/.jazzignore/**</exclude>
						   <exclude>**/.classpath/**</exclude>
						   <exclude>**/*.properties</exclude>
               <exclude>**/*.class</exclude>
						   <exclude>**/*.wsdl</exclude>
						   <exclude>**/*.xsd</exclude>
						   <exclude>**/*.xml</exclude>
						   <exclude>**/*.sql</exclude>
						   <exclude>**/*.MF</exclude>
						   <exclude>**/*.sql</exclude>
						   <exclude>**/*.jks</exclude>
						   <exclude>**/*.NSP</exclude>
						   <exclude>**/*.sh</exclude>
               <exclude>**/*.txt</exclude>
               <exclude>**/*.jmx</exclude>
               <exclude>**/*.jpg</exclude>
               <exclude>**/*.pdf</exclude>
               <exclude>**/*.htm</exclude>
					   </excludes>
					   <properties>
					   </properties>
					   <encoding>UTF-8</encoding>
					</configuration>
					<executions>
					   <execution>
						   <goals>
							   <goal>format</goal>
						   </goals>
					   </execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
  <repositories>
    <repository>
      <id>central</id>
      <name>Maven Repository Switchboard</name>
      <url>http://repo1.maven.org/maven2</url>
    </repository>
    <repository>
      <id>Trifork-Nexus-Public-Repository</id>
      <name>Trifork Nexus Public Repository</name>
      <url>https://nexus.trifork.com/content/groups/public/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Maven Plugin Repository</name>
      <url>http://repo1.maven.org/maven2</url>
    </pluginRepository>
    <pluginRepository>
      <id>Trifork-Nexus-Public-Repository</id>
      <name>Trifork Nexus Public Repository</name>
      <url>https://nexus.trifork.com/content/groups/public/</url>
    </pluginRepository>
  </pluginRepositories>
</project>