<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>com.draeger.medical</groupId>
  <artifactId>BICEPS</artifactId>
  <version>OR.NET-BETA_06-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>BICEPS</name>
  <url>https://sourceforge.net/projects/opensdc/</url>

  <distributionManagement>
    <snapshotRepository>
    <id>isp</id>
    <url>http://sourcecode.isp.uni-luebeck.de/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <profiles>
  <!-- 	JAXB does not generate valid doclet comments when using jdk8
		http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html -->
	<profile>
		<id>doclint-java8-disable</id>
		<activation>
			<jdk>[1.8,)</jdk>
		</activation>
		<properties>
			<javadoc.opts>-Xdoclint:none</javadoc.opts>
		</properties>
	</profile>
  </profiles>
  
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<groupId>${project.groupId}</groupId>
    <artifactId>${project.artifactId}</artifactId>
    <version>${project.version}</version>
    <packaging>${project.packaging}</packaging>
    <file>${project.build.directory}/${project.artifactId}-${project.version}.${project.packaging}</file>
	<biceps.xsd.forceRegenerate>true</biceps.xsd.forceRegenerate>
	
	<biceps.xsd.dir>${project.build.resources[0].directory}/xsd/v2</biceps.xsd.dir>
	<biceps.xslt.dir>${project.build.resources[0].directory}/xslt</biceps.xslt.dir>
	
	<!--
	<biceps.xsd.msg.dir>com/draeger/medical/biceps/common/messages/v2/xsd</biceps.xsd.msg.dir>
	<biceps.xsd.msg.package>com.draeger.medical.biceps.common.messages.v2</biceps.xsd.msg.package>
	<biceps.xsd.msg.targetdir>${project.build.outputDirectory}/${biceps.xsd.msg.dir}</biceps.xsd.msg.targetdir>
	<biceps.xsd.msg.targetname>BICEPS_MessagesV2.xsd</biceps.xsd.msg.targetname>
	<biceps.xsd.msg.releasename>BICEPSModel_MIM.xsd</biceps.xsd.msg.releasename>-->
	
	<biceps.xsd.model.dir>com/draeger/medical/biceps/common/messages/v2/xsd</biceps.xsd.model.dir>
	<biceps.xsd.model.package>com.draeger.medical.biceps.common.model</biceps.xsd.model.package>
	<biceps.xsd.model.targetdir>${project.build.outputDirectory}/${biceps.xsd.model.dir}</biceps.xsd.model.targetdir>
	<biceps.xsd.model.targetname>BICEPS_Model.xsd</biceps.xsd.model.targetname>
	<biceps.xsd.dim.targetname>BICEPS_DomainModel.xsd</biceps.xsd.dim.targetname>
	<biceps.xsd.ext.targetname>ExtensionPoint.xsd</biceps.xsd.ext.targetname>
	
  </properties>
  
  <dependencies>
	<dependency>
		<groupId>xpp3</groupId>
		<artifactId>xpp3</artifactId>
		<version>1.1.4c</version>
	</dependency>
	<dependency>
		<groupId>net.sf.beanlib</groupId>
		<artifactId>beanlib</artifactId>
		<version>5.0.2beta</version>
	</dependency>
	<dependency>
		<groupId>com.sun.xml.fastinfoset</groupId>
		<artifactId>FastInfoset</artifactId>
		<version>1.2.13</version>
	</dependency>
	<dependency>
		<groupId>com.draeger.medical</groupId>
		<artifactId>JDPWS</artifactId>
		<version>OR.NET-BETA_06-SNAPSHOT</version>
    </dependency>
	<dependency>
		<groupId>com.draeger.medical</groupId>
		<artifactId>MDPWS</artifactId>
		<version>OR.NET-BETA_06-SNAPSHOT</version>
    </dependency>
	<!-- for jaxb2:xjc -->
	<dependency>
		<groupId>javax.xml.bind</groupId>
		<artifactId>jaxb-api</artifactId>
        <version>2.2.11</version>
    </dependency>
	<dependency>
		<groupId>org.jvnet.jaxb2_commons</groupId>
		<artifactId>jaxb2-basics-runtime</artifactId>
		<version>0.6.5.1</version>
	</dependency>
	<dependency>
        <groupId>org.jvnet.jaxb2_commons</groupId>
		<artifactId>jaxb2-namespace-prefix</artifactId>
		<version>1.1</version>
	</dependency>
	<!-- for tests -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    </dependencies>
  <build>
	<plugins> 
		<plugin> 
			<groupId>org.apache.maven.plugins</groupId> 
			<artifactId>maven-compiler-plugin</artifactId> 
			<version>3.1</version>
			<configuration> 
				<source>1.6</source> 
				<target>1.6</target> 
				
				<!-- compilerArguments are ignore in Maven 3.0+ by default,
				force old compiler usage. See:
				https://jira.codehaus.org/browse/MCOMPILER-201 -->
				<forceJavacCompilerUse>true</forceJavacCompilerUse>
				
				<compilerArgument>-XDignore.symbol.file</compilerArgument>
			</configuration> 
		</plugin> 
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-source-plugin</artifactId>
			<version>2.3</version>
			<executions>
				<execution>
					<phase>package</phase>
					<goals>
						<goal>jar-no-fork</goal>
					</goals>
				</execution>
			</executions>
		</plugin>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>xml-maven-plugin</artifactId>
			<version>1.0</version>
			<executions>
			  <execution>
				
				<!-- xsd file generation must be done before the "generate-sources" phase -->
				<phase>initialize</phase>
				
				<goals>
				  <goal>transform</goal>
				</goals>
			  </execution>
			</executions>
			<configuration>
			  <transformationSets>
			  	<transformationSet>
				  <dir>${biceps.xsd.dir}</dir>
				  <includes>
					<include>ExtensionPoint.xsd</include>
				  </includes>
				  <stylesheet>${biceps.xslt.dir}/CreateModelXSD.xslt</stylesheet>
				  <outputDir>${biceps.xsd.model.targetdir}</outputDir>
				  <fileMappers>
					<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
						<targetName>${biceps.xsd.ext.targetname}</targetName>
					</fileMapper>
				  </fileMappers>
				</transformationSet>
			  	<transformationSet>
				  <dir>${biceps.xsd.dir}</dir>
				  <includes>
					<include>BICEPS_DomainModel.xsd</include>
				  </includes>
				  <stylesheet>${biceps.xslt.dir}/CreateModelXSD.xslt</stylesheet>
				  <outputDir>${biceps.xsd.model.targetdir}</outputDir>
				  <fileMappers>
					<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
						<targetName>${biceps.xsd.dim.targetname}</targetName>
					</fileMapper>
				  </fileMappers>
				</transformationSet>
				<transformationSet>
				  <dir>${biceps.xsd.dir}</dir>
				  <includes>
					<include>BICEPS_MessageModel.xsd</include>
				  </includes>
				  <stylesheet>${biceps.xslt.dir}/CreateModelXSD.xslt</stylesheet>
				  <outputDir>${biceps.xsd.model.targetdir}</outputDir>
				  <fileMappers>
					<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
						<targetName>${biceps.xsd.model.targetname}</targetName>
					</fileMapper>
				  </fileMappers>
				</transformationSet>
				<!--transformationSet>
				  <dir>${biceps.xsd.dir}</dir>
				  <includes>
					<include>BICEPS_MessageInformationModel.xsd</include>
				  </includes>
				  <stylesheet>${biceps.xslt.dir}/CreateModelXSD.xslt</stylesheet>
				  <outputDir>${biceps.xsd.msg.targetdir}</outputDir>
				  <fileMappers>
					<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
						<targetName>${biceps.xsd.msg.targetname}</targetName>
					</fileMapper>
				  </fileMappers>
				</transformationSet-->
				<!--transformationSet>
				  <dir>${biceps.xsd.dir}</dir>
				  <includes>
					<include>BICEPS_MessageInformationModel.xsd</include>
				  </includes>
				  <stylesheet>${biceps.xslt.dir}/CreateDocuXSD.xslt</stylesheet>
				  <outputDir>${biceps.xsd.msg.targetdir}</outputDir>
				  <fileMappers>
					<fileMapper implementation="org.codehaus.plexus.components.io.filemappers.MergeFileMapper">
						<targetName>${biceps.xsd.msg.releasename}</targetName>
					</fileMapper>
				  </fileMappers>
				</transformationSet-->
			  </transformationSets>
			</configuration>
      </plugin>
        <!-- JAXB xjc plugin that invokes the xjc compiler to compile XML schema into Java classes.-->
        <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.10.0</version>
            <executions>
                <execution>
					<id>jaxb-model</id>
					<phase>generate-sources</phase>					
					<configuration>
						<!-- The schema directory or xsd files. -->
						<locale>en-us</locale>
						<forceRegenerate>${biceps.xsd.forceRegenerate}</forceRegenerate>
						<readOnly>true</readOnly> 
						<schemaDirectory>${biceps.xsd.model.targetdir}</schemaDirectory>
						<schemaIncludes>
							<include>${biceps.xsd.model.targetname}</include>
						</schemaIncludes>
						<!-- The package in which the source files will be generated. -->
						<generatePackage>${biceps.xsd.model.package}</generatePackage>
						<!-- The working directory to create the generated java source files. -->
						<outputDirectory>${project.build.directory}/generated-sources/jaxb/model</outputDirectory>
						<args>
							<arg>-npa</arg>
							<arg>-no-header</arg>
							<arg>-Xsetters</arg>
							<arg>-Xsetters-mode=accessor</arg>
							<!--arg>-Xnamespace-prefix</arg-->
						</args>
						<plugins>
							<plugin>
								<groupId>org.jvnet.jaxb2_commons</groupId>
								<artifactId>jaxb2-basics</artifactId>
								<version>0.6.5</version>
							</plugin>
						</plugins>
					</configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
				<!--execution>
					<id>jaxb-message</id>
					<phase>generate-sources</phase>					
					<configuration>
						<locale>en-us</locale>
						<forceRegenerate>${biceps.xsd.forceRegenerate}</forceRegenerate>
						<readOnly>true</readOnly> 
						<schemaDirectory>${biceps.xsd.msg.targetdir}</schemaDirectory>
						<schemaIncludes>
							<include>${biceps.xsd.msg.targetname}</include>
						</schemaIncludes>
						<generatePackage>${biceps.xsd.msg.package}</generatePackage>
						<outputDirectory>${project.build.directory}/generated-sources/jaxb/msg</outputDirectory>
						<args>
							<arg>-npa</arg>
							<arg>-no-header</arg>
							<arg>-Xsetters</arg>
							<arg>-Xsetters-mode=accessor</arg>
						</args>
						<plugins>
							<plugin>
								<groupId>org.jvnet.jaxb2_commons</groupId>
								<artifactId>jaxb2-basics</artifactId>
								<version>0.6.5</version>
							</plugin>
						</plugins>
					</configuration>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution-->
            </executions>
        </plugin>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-javadoc-plugin</artifactId>
			<version>2.10.1</version>
			<executions>
				<execution>
					<id>attach-javadocs</id>
					<goals>
						<goal>jar</goal>
					</goals>
				</execution>
			</executions>
			<configuration>
				<additionalparam>${javadoc.opts}</additionalparam>
			</configuration>
		</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.0</version>
				<configuration>
					<lifecycleMappingMetadata>
						<pluginExecutions>
							<pluginExecution>
								<pluginExecutionFilter>
									<groupId>org.codehaus.mojo</groupId>
									<artifactId>
										xml-maven-plugin
									</artifactId>
									<versionRange>[1.0,)</versionRange>
									<goals>
										<goal>transform</goal>
									</goals>
								</pluginExecutionFilter>
								<action>
									<execute></execute>
								</action>
							</pluginExecution>
						</pluginExecutions>
					</lifecycleMappingMetadata>
				</configuration>
			</plugin>
		</plugins>
	</pluginManagement>
  </build>
</project>
