<?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">
    <parent>
        <groupId>ru.entaxy.esb.platform.runtime.core.infrastructure</groupId>
        <artifactId>schema</artifactId>
        <version>1.10.1</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>ru.entaxy.esb.platform.runtime.core.infrastructure.schema</groupId>
    <artifactId>schema-soap</artifactId>
    <packaging>bundle</packaging>

    <name>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: INFRASTRUCTURE :: SCHEMA :: SOAP</name>
    <description>ENTAXY :: PLATFORM :: RUNTIME :: CORE :: INFRASTRUCTURE :: SCHEMA :: SOAP</description>

    <properties>
        <bundle.osgi.import.pkg>
            !com.sun.org.apache.xml.internal.dtm.ref,
            !org.mapstruct.*,
            javax.jws.*;version="[2.0.0,3.0.0)",
            javax.jws.soap.*;version="[2.0.0,3.0.0)",
            javax.xml.ws.*;version="[2.2.0,3.0.0)",
            org.apache.commons.logging,
            org.osgi.service.blueprint;version="[1.0.0,2.0.0)",
            *
        </bundle.osgi.import.pkg>
        <!-- bundle.osgi.private.pkg>
        	ru.entaxy.esb.platform.runtime.core.infrastructure.schema.soap,
        	ru.entaxy.esb.platform.runtime.core.infrastructure.schema.soap.cxf,
        	ru.entaxy.esb.platform.runtime.core.infrastructure.schema.soap.mapper
        </bundle.osgi.private.pkg -->
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct-processor</artifactId>
            <version>${mapstruct.version}</version>
        </dependency>
        <dependency>
            <groupId>ru.entaxy.esb.platform.runtime.core.infrastructure.schema</groupId>
            <artifactId>schema-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>ru.entaxy.esb.platform.runtime.core.infrastructure.schema</groupId>
            <artifactId>schema-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf</artifactId>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>src/main/non-packaged-resources/etc/ru.entaxy.esb.platform.runtime.core.infrastructure.schema.cfg</file>
                                    <type>cfg</type>
                                    <classifier>ru.entaxy.esb.platform.runtime.core.infrastructure.schema</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <release>11</release>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>${mapstruct.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dev</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.cxf</groupId>
                        <artifactId>cxf-codegen-plugin</artifactId>
                        <version>${cxf.version}</version>
                        <executions>
                            <execution>
                                <id>generate-sources</id>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <sourceRoot>src/main/java</sourceRoot>
                                    <wsdlOptions>
                                        <wsdlOption>
                                            <wsdl>${basedir}/src/main/resources/wsdl/registry-schema-service.wsdl</wsdl>
                                            <wsdlLocation>classpath:wsdl/registry-schema-service.wsdl</wsdlLocation>
                                            <extraargs>
                                                <extraarg>-p</extraarg>
                                                <extraarg>ru.entaxy.esb.platform.runtime.core.infrastructure.schema.soap.cxf</extraarg>
                                                <extraarg>-bareMethods</extraarg>
                                            </extraargs>
                                            <extendedSoapHeaders>true</extendedSoapHeaders>
                                        </wsdlOption>
                                    </wsdlOptions>
                                </configuration>
                                <goals>
                                    <goal>wsdl2java</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
