<?xml version="1.0" encoding="UTF-8"?>
<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>
	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>3.2.12</version>
		<relativePath /> <!-- lookup parent from repository -->
	</parent>

	<groupId>com.lightcomp</groupId>
	<artifactId>imwhooser</artifactId>
	<version>1.0.6</version>
	<name>imwhooser</name>
	<description>Realizace integrace mezi Elzou a systémem WhoIs</description>

	<properties>
		<java.version>17</java.version>
        <org.javalite.version>3.2</org.javalite.version>
        <cxf.version>4.1.1</cxf.version>
        <org.openapitools.version>7.9.0</org.openapitools.version> <!-- 7.9.0 / 4.3.1 -->
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jdbc</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

		<dependency>
		    <groupId>org.springframework.boot</groupId>
		    <artifactId>spring-boot-starter-web</artifactId>
		</dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
		</dependency>

		<dependency>
		    <groupId>org.springframework.boot</groupId>
		    <artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>

		<dependency>
    		<groupId>io.micrometer</groupId>
    		<artifactId>micrometer-registry-prometheus</artifactId>
		</dependency>

		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<scope>runtime</scope>
		</dependency>

		<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc17 -->
		<dependency>
		    <groupId>com.oracle.database.jdbc</groupId>
		    <artifactId>ojdbc17</artifactId>
		    <version>23.6.0.24.10</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.junit.vintage</groupId>
					<artifactId>junit-vintage-engine</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

	    <dependency>
      		<groupId>org.liquibase</groupId>
      		<artifactId>liquibase-core</artifactId>
      		<exclusions>
        		<exclusion>
          			<groupId>ch.qos.logback</groupId>
          			<artifactId>logback-classic</artifactId>
        		</exclusion>
      		</exclusions>
    	</dependency>

		<dependency>
    		<groupId>org.javalite</groupId>
    		<artifactId>activejdbc</artifactId>
    		<version>${org.javalite.version}</version>
		</dependency>

	    <dependency>
	      <groupId>org.apache.commons</groupId>
	      <artifactId>commons-lang3</artifactId>
	    </dependency>

        <!-- swagger ui -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>2.6.0</version>
        </dependency>

	    <dependency>
	    	<groupId>io.swagger</groupId>
	    	<artifactId>swagger-annotations</artifactId>
	    	<version>1.6.12</version>
	    </dependency>

        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>2.2.19</version>
		</dependency>

		<dependency>
			<groupId>org.openapitools</groupId>
			<artifactId>jackson-databind-nullable</artifactId>
			<version>0.2.1</version>
		</dependency>

		<!-- https://mvnrepository.com/artifact/jakarta.xml.ws/jakarta.xml.ws-api -->
		<dependency>
		    <groupId>jakarta.xml.ws</groupId>
		    <artifactId>jakarta.xml.ws-api</artifactId>
		</dependency>

		<!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api -->
		<dependency>
		    <groupId>jakarta.xml.bind</groupId>
		    <artifactId>jakarta.xml.bind-api</artifactId>
		</dependency>

		<!-- https://mvnrepository.com/artifact/jakarta.mail/jakarta.mail-api -->
		<dependency>
		    <groupId>jakarta.mail</groupId>
		    <artifactId>jakarta.mail-api</artifactId>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
		<dependency>
		    <groupId>org.glassfish.jaxb</groupId>
		    <artifactId>jaxb-runtime</artifactId>
		</dependency>

		<!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
		</dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-spring-boot-starter-jaxws</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-transports-http</artifactId>
		    <version>${cxf.version}</version>
		</dependency>

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

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

		<!-- bibliographic data processing library for Java -->
		<dependency>
    		<groupId>org.xbib</groupId>
    		<artifactId>marc</artifactId>
    		<version>2.8.0</version>
		</dependency>

        <!-- pro testování -->
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<build>
	    <finalName>imwhooser</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <!--<source>11</source>
		            <target>11</target>
                    <release>8</release>-->
                    <release>${maven.compiler.release}</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>com.lightcomp.imwhooser.Application</mainClass>
                    <executable>true</executable>
                    <layout>JAR</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-gen-sources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-source</goal>
						</goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/generated-sources/api/rest</source>
                                <source>${project.build.directory}/generated-sources/cam</source>
                                <source>${project.build.directory}/generated-sources/cfx</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
                <groupId>org.openapitools</groupId>
                <artifactId>openapi-generator-maven-plugin</artifactId>
                <version>${org.openapitools.version}</version>
				<executions>
					<execution>
			            <id>openapi-imwhooser-spring</id>
			            <phase>generate-sources</phase>
			            <goals>
							<goal>generate</goal>
			            </goals>
            			<configuration>
			              	<generatorName>spring</generatorName>
			              	<inputSpec>${project.basedir}/src/main/resources/openapi/imwhooser-api.yaml</inputSpec>
			              	<output>${project.build.directory}/generated-sources/api/rest</output>
			              	<apiPackage>com.lightcomp.imwhooser.api.rest</apiPackage>
			              	<modelPackage>com.lightcomp.imwhooser.api.rest.model</modelPackage>
			              	<generateSupportingFiles>false</generateSupportingFiles>
			              	<configOptions>
			                	<sourceFolder>/</sourceFolder>
                                <skipDefaultInterface>true</skipDefaultInterface>
			                	<dateLibrary>java8-localdatetime</dateLibrary>
			                	<useJakartaEe>true</useJakartaEe>
			                	<interfaceOnly>true</interfaceOnly>
			                	<useTags>true</useTags>
			            	</configOptions>
			            </configuration>
					</execution>
                    <execution>
                        <id>openapi-cam-client</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <generatorName>spring</generatorName>
                            <inputSpec>${project.basedir}/src/main/resources/openapi/cam-openapi.yml</inputSpec>
                            <output>${project.build.directory}/generated-sources/api/rest</output>
                            <apiPackage>cz.tacr.cam.controller</apiPackage>
                            <modelPackage>cz.tacr.cam.controller.vo</modelPackage>
                            <configOptions>
			                	<sourceFolder>/</sourceFolder>
                                <skipDefaultInterface>true</skipDefaultInterface>
			                	<dateLibrary>java8-localdatetime</dateLibrary>
			                	<useJakartaEe>true</useJakartaEe>
			                	<interfaceOnly>true</interfaceOnly>
			                	<useTags>true</useTags>
                            </configOptions>
                        </configuration>
                    </execution>
                    <execution>
                        <id>openapi-elza-client</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <generatorName>java</generatorName>
                            <inputSpec>${project.basedir}/src/main/resources/openapi/elza-openapi.yml</inputSpec>
                            <output>${project.build.directory}/generated-sources/api/elza</output>
                            <apiPackage>cz.tacr.elza.controller</apiPackage>
                            <modelPackage>cz.tacr.elza.controller.vo</modelPackage>
                            <configOptions>
                                <useJakartaEe>true</useJakartaEe>
                                <library>resttemplate</library><!-- default: okhttp-gson -->
                                <useAbstractionForFiles>true</useAbstractionForFiles>
                            </configOptions>
                        </configuration>
                    </execution>
				</executions>
			</plugin>
            <plugin>
                <groupId>org.jvnet.jaxb</groupId>
                <artifactId>jaxb-maven-plugin</artifactId>
                <version>4.0.0</version>
                <executions>
                    <execution>
                        <id>cam-2019</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <phase>generate-sources</phase>
                        <configuration>
                            <extension>true</extension>
                            <args>
                                <arg>-Xannotate</arg>
                                <arg>-Xinheritance</arg>
                                <arg>-Xvalue-constructor</arg>
                        		<arg>-XsimpleEquals</arg>
                        		<arg>-XsimpleHashCode</arg>
							</args>
                            <generateDirectory>${project.build.directory}/generated-sources/cam</generateDirectory>
                            <schemaDirectory>${project.basedir}/src/main/resources/schema</schemaDirectory>
                			<schemaIncludes>
                    			<include>cam-2019.xsd</include>
                			</schemaIncludes>
                            <bindingDirectory>${project.basedir}/src/main/resources/schema</bindingDirectory>
                            <bindingIncludes>
                                <include>cam-2019.xjb</include>
							</bindingIncludes>
                            <plugins>
                                <plugin>
                                    <groupId>org.jvnet.jaxb</groupId>
                                    <artifactId>jaxb-plugins</artifactId>
                                    <version>4.0.0</version>
								</plugin>
							</plugins>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>io.swagger.core.v3</groupId>
                        <artifactId>swagger-annotations</artifactId>
                        <version>2.2.19</version>
					</dependency>
                    <dependency>
                        <groupId>org.jvnet.jaxb</groupId>
                        <artifactId>jaxb-plugins</artifactId>
                        <version>4.0.0</version>
					</dependency>
                    <dependency>
                        <groupId>org.jvnet.jaxb</groupId>
                        <artifactId>jaxb-plugin-annotate</artifactId>
                        <version>4.0.0</version>
					</dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>4.0.2</version><!-- 3.3.0 -->
                <executions>
                    <execution>
                        <id>elza-core</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
                            <defaultOptions>
                            	<exceptionSuper>java.lang.RuntimeException</exceptionSuper>
								<!-- Note: extraargs cannot be specified inside defaultOptions due to bug in plugin -->
                            </defaultOptions>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/wsdl/elza-core-v1.wsdl</wsdl>
									<wsdlLocation>classpath:/wsdl/elza-core-v1.wsdl</wsdlLocation>
									<autoNameResolution>true</autoNameResolution>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>peva</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
                            <defaultOptions>
                            	<exceptionSuper>java.lang.RuntimeException</exceptionSuper>
								<!-- Note: extraargs cannot be specified inside defaultOptions due to bug in plugin -->
                            </defaultOptions>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/wsdl/peva_v2.wsdl</wsdl>
									<wsdlLocation>classpath:/wsdl/peva_v2.wsdl</wsdlLocation>
									<autoNameResolution>true</autoNameResolution>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.javalite</groupId>
                <artifactId>activejdbc-instrumentation</artifactId>
                <version>${org.javalite.version}</version>
                <executions>
                    <execution>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>3.1.1</version>
			</plugin>
        </plugins>
	</build>
	<profiles>
		<!-- Use this profile to build release version of the application -->
		<profile>
			<id>release</id>
		</profile>
	</profiles>
    <scm>
        <connection>scm:git:ssh://gitlab.lightcomp.cz/ukais/imwhooser.git</connection>
        <developerConnection>scm:git:ssh://git@gitlab.lightcomp.cz/ukais/imwhooser.git</developerConnection>
        <tag>imwhooser-1.0.6</tag>
    </scm>
	<distributionManagement>
		<repository>
			<id>LightCompReleaseRepository</id>
			<url>http://artifactory.lightcomp.cz:8081/artifactory/distributions</url>
		</repository>
	</distributionManagement>
</project>
