<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>at.vvo.omds</groupId>
  <artifactId>OMDSServiceDefinition</artifactId>
  <version>1.8.0-SNAPSHOT</version>
  <name>OMDS Service Definition</name>
  <description>Dieses Projekt enthaelt die Definitionen fuer die OMDS Services.</description>
  
	<properties>
		<currentReleaseDir>r1_8_0</currentReleaseDir>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		
		<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>
	    <timestamp>${maven.build.timestamp}</timestamp>

		<wsdl.name>omds3Services.wsdl</wsdl.name>
		<bindings.location.rel>/src/main/resources/bind/${currentReleaseDir}</bindings.location.rel>
		<target.generation.path>${basedir}/src/main/java</target.generation.path>
		<bindings.location>${basedir}${bindings.location.rel}</bindings.location>
		<wsdl.location>src/main/resources/def/${currentReleaseDir}/${wsdl.name}</wsdl.location>

		<jdk.version>1.8</jdk.version>
	    <maven.compiler.source>${jdk.version}</maven.compiler.source>
	    <maven.compiler.target>${jdk.version}</maven.compiler.target>


		<!-- Typischer Pfad zu wsdl.exe: "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\wsdl.exe" -->
	    <cxf.version>3.5.0</cxf.version>
	</properties>
	
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.cxf</groupId>
					<artifactId>cxf-codegen-plugin</artifactId>
					<version>${cxf.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-help-plugin</artifactId>
					<version>2.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.0.4</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>2.3.2</version>
				</plugin>
				<plugin>
		        	<groupId>org.apache.maven.plugins</groupId>
		        	<artifactId>maven-assembly-plugin</artifactId>
		        	<version>3.1.0</version>
		        </plugin>
		        <plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>3.0.1</version>
					</plugin>			
	        </plugins>
		</pluginManagement>
		
  		<plugins>
	  	  	<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-help-plugin</artifactId>
			</plugin>
			
	  		<plugin>
        		<groupId>org.apache.maven.plugins</groupId>
        		<artifactId>maven-assembly-plugin</artifactId>
        		<configuration>
		        	<descriptors>
		            	<descriptor>assembly.xml</descriptor>
		        	</descriptors>
		        </configuration>
		        <executions>
		        	<execution>
		            	<id>make-assembly</id> <!-- this is used for inheritance merges -->
		            	<phase>install</phase> <!-- bind to the install phase, damit source-jar und javadoc-jar mit eingepackt werden -->
		            	<goals>
		            		<goal>single</goal>
		        		</goals>
		        	</execution>
        		</executions>
      		</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<verbose>true</verbose>
					<fork>true</fork>
					<compilerVersion>${jdk.version}</compilerVersion>
					<source>${jdk.version}</source>
					<target>${jdk.version}</target>
					<encoding>UTF-8</encoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.3.1</version>
				<configuration>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
<!--							<Revision>${SVN_REVISION}</Revision>-->
<!--							<BuildTag>${BUILD_TAG}</BuildTag>-->
							<BuildTimestamp>${maven.build.timestamp}</BuildTimestamp>
							<JDKVersion>${jdk.version}</JDKVersion>
						</manifestEntries>
					</archive>
				</configuration>
		    </plugin> 
		    <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19.1</version>
				<configuration>
					<excludes>
						<!-- The test cases only run when a web container deploys the webservice. -->
						<exclude>at/ergo/plr/CalculatorWebClientTest.java</exclude>
					</excludes>
				</configuration>
			</plugin>
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
					<executions>
						<execution>
						<id>attach-javadocs</id>
						<goals>
				        	<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>			
			
		</plugins>
	</build>
	<dependencyManagement>
		<dependencies>
			<!-- CFX Start -->
			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-frontend-simple</artifactId>
				<version>${cxf.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-frontend-jaxws</artifactId>
				<version>${cxf.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-bindings-soap</artifactId>
				<version>${cxf.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-transports-http</artifactId>
				<version>${cxf.version}</version>
			</dependency>
			<!-- Jetty is needed if you're are not using the CXFServlet -->
			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-transports-http-jetty</artifactId>
				<version>${cxf.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-ws-security</artifactId>
				<version>${cxf.version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.cxf</groupId>
				<artifactId>cxf-rt-features-logging</artifactId>
				<version>${cxf.version}</version>
			</dependency>

			<!-- CFX Ende -->
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>3.8.2</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<dependencies>
	
		<!-- CFX Start -->
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-simple</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-frontend-jaxws</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-bindings-soap</artifactId>
		</dependency>

		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http</artifactId>
		</dependency>
	    <!-- Jetty is needed if you're are not using the CXFServlet -->
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-transports-http-jetty</artifactId>
		</dependency>
		
		<dependency>
			<groupId>org.apache.cxf</groupId>
			<artifactId>cxf-rt-ws-security</artifactId>
		</dependency>
		
		<dependency>
		    <groupId>org.apache.cxf</groupId>
		    <artifactId>cxf-rt-features-logging</artifactId>
		</dependency>
		
		<!-- CFX Ende -->
	
<!--		<dependency>-->
<!--			<groupId>log4j</groupId>-->
<!--			<artifactId>log4j</artifactId>-->
<!--			<version>1.2.12</version>-->
<!--			<scope>test</scope>-->
<!--		</dependency>-->
		
<!--		<dependency>-->
<!--			<groupId>junit</groupId>-->
<!--			<artifactId>junit</artifactId>-->
<!--			<scope>test</scope>-->
<!--		</dependency>-->
	</dependencies>
  
	<!-- Zielordner fuer Deploy unter OMDS-Entwicklung -->
	<distributionManagement>
		<repository>
			<id>omdsaccess</id><!-- Username-Passwort in servers im settings.xml unter dieser id -->
			<name>OMDS Release Repository</name>
			<url>http://entw.kapdion.com:8081/repository/omdsReleases/</url>
		</repository>
		<snapshotRepository>
			<id>omdsaccess</id><!-- Username-Passwort in servers im settings.xml unter dieser id -->
			<name>OMDS Snapshot Repository</name>
			<url>http://entw.kapdion.com:8081/repository/omdsSnapshots/</url>
		</snapshotRepository>
	</distributionManagement>
	
	
	<profiles>
	
		<!-- Spezielles Profil um Java-Code fuer die VU-Schnittstelle aus dem WSDL zu generieren  -->
		<profile>
			<id>genJavaFromWsdl_VU</id>
			<activation>
				<activeByDefault>true</activeByDefault>
				<property>
					<name>codeGen</name>
				</property>
			</activation>
			<properties>

				<wsdl.name>omds3Services.wsdl</wsdl.name>
				<wsdl.binding.xml>wsdl_binding.xml</wsdl.binding.xml>
			</properties>
			<build>
				<plugins>
					<plugin>
					    <groupId>org.apache.cxf</groupId>
					    <artifactId>cxf-codegen-plugin</artifactId>
					    <configuration>
					    	<additionalJvmArgs>-Djavax.xml.accessExternalSchema=all</additionalJvmArgs>
					    </configuration>
					    <executions>
					        <execution>
					            <id>generate-sources</id>
					            <phase>generate-sources</phase>
					            <configuration>
					                <sourceRoot>${target.generation.path}</sourceRoot>
					                <wsdlOptions>
					                    <wsdlOption>
					                        <wsdl>${wsdl.location}</wsdl>
					                        <extendedSoapHeaders>true</extendedSoapHeaders>
																                        
					                        <!-- wsdl/jaxb Binding wie der Code generiert werden soll -->
																  <bindingFiles>
										    	<bindingFile>${bindings.location}/omds20Types_binding.xml</bindingFile>
										    	<bindingFile>${bindings.location}/omdsServiceTypes_binding.xml</bindingFile>
										    	<bindingFile>${bindings.location}/omdsCommonServiceTypes_binding.xml</bindingFile>
										    	<bindingFile>${bindings.location}/omds3_ON1_Basisfunktionen_binding.xml</bindingFile>
										    	<bindingFile>${bindings.location}/omds3_ON2_Antrag_Common_binding.xml</bindingFile>
										    	<bindingFile>${bindings.location}/omds3_ON2_Antrag_Kfz_binding.xml</bindingFile>
										    	<bindingFile>${bindings.location}/omds3_ON2_Antrag_SachPrivat_binding.xml</bindingFile>
 										    	<bindingFile>${bindings.location}/omds3_ON2_Antrag_Unfall_binding.xml</bindingFile>
												  <bindingFile>${bindings.location}/omds3_ON2_Antrag_Leben_binding.xml</bindingFile>
												  <bindingFile>${bindings.location}/omds3_ON2_Antrag_Kranken_binding.xml</bindingFile>
												  <bindingFile>${bindings.location}/omds3_ON2_Antrag_RS_binding.xml</bindingFile>
												  <bindingFile>${bindings.location}/omds3_ON7_Schaden_binding.xml</bindingFile>
										    	<bindingFile>${bindings.location}/${wsdl.binding.xml}</bindingFile>
										    </bindingFiles>
					                        
							                <!-- you can set the options of wsdl2java command by using the <extraargs> -->
							                <extraargs>
							                	<!-- <extraarg>-v</extraarg> zeige Versionsnummer dieses Tools -->
							                	<extraarg>-impl</extraarg><!-- Implementation -->
							                	<extraarg>-validate</extraarg>
							                    <extraarg>-client</extraarg><!-- Auch Ansatzpunkt fuer Client generieren -->
							                    <extraarg>-verbose</extraarg>
							                </extraargs>
			    						</wsdlOption>
					                </wsdlOptions>
					            </configuration>
					            <goals>
					                <goal>wsdl2java</goal>
					            </goals>
					        </execution>
					    </executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>genJavaFromWsdl_Broker</id>
			<activation>
				<activeByDefault>false</activeByDefault>
				<property>
					<name>codeGen</name>
				</property>
			</activation>
			<properties>
				<wsdl.name>omds3ServicesBroker.wsdl</wsdl.name>
				<wsdl.binding.xml>wsdl_broker_binding.xml</wsdl.binding.xml>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.cxf</groupId>
						<artifactId>cxf-codegen-plugin</artifactId>
						<configuration>
							<additionalJvmArgs>-Djavax.xml.accessExternalSchema=all</additionalJvmArgs>
						</configuration>
						<executions>
							<execution>
								<id>generate-sources</id>
								<phase>generate-sources</phase>
								<configuration>
									<sourceRoot>${target.generation.path}</sourceRoot>
									<wsdlOptions>
										<wsdlOption>
											<wsdl>${wsdl.location}</wsdl>
											<extendedSoapHeaders>true</extendedSoapHeaders>

											<!-- wsdl/jaxb Binding wie der Code generiert werden soll -->
											<bindingFiles>
												<bindingFile>${bindings.location}/omds20Types_binding.xml</bindingFile>
												<bindingFile>${bindings.location}/omdsServiceTypes_binding.xml</bindingFile>
												<bindingFile>${bindings.location}/omdsCommonServiceTypes_binding.xml</bindingFile>
												<bindingFile>${bindings.location}/omds3_ON7_Schaden_binding.xml</bindingFile>
												<bindingFile>${bindings.location}/${wsdl.binding.xml}</bindingFile>
											</bindingFiles>

											<!-- you can set the options of wsdl2java command by using the <extraargs> -->
											<extraargs>
												<!-- <extraarg>-v</extraarg> zeige Versionsnummer dieses Tools -->
												<extraarg>-impl</extraarg><!-- Implementation -->
												<extraarg>-validate</extraarg>
												<extraarg>-client</extraarg><!-- Auch Ansatzpunkt fuer Client generieren -->
												<extraarg>-verbose</extraarg>
											</extraargs>
										</wsdlOption>
									</wsdlOptions>
								</configuration>
								<goals>
									<goal>wsdl2java</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>


	</profiles>
  
</project> 
