<!--

 Copyright (c) 2006-2021 Talend Inc. - www.talend.com
 All rights reserved.

 This program and the accompanying materials are made available
 under the terms of the Apache License v2.0
 which accompanies this distribution, and is available at
 http://www.apache.org/licenses/LICENSE-2.0

 -->
<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>
	<groupId>org.talend.esb</groupId>
	<artifactId>locator</artifactId>
	<name>Talend ESB :: Locator</name>
	<description>Service Locator Client for CXF</description>
	<packaging>bundle</packaging>

	<parent>
		<groupId>org.talend.esb</groupId>
		<artifactId>bom</artifactId>
		<version>8.0.1</version>
        <relativePath>../bom</relativePath>
	</parent>

	<dependencies>
	    <dependency>
            <groupId>org.ops4j.pax.cdi</groupId>
            <artifactId>pax-cdi-api</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
        </dependency>
	    <!-- For the spring annotations -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>spring-aop</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-core</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-expression</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-asm</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
            </exclusions>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>jline</groupId>
                    <artifactId>jline</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.netty</groupId>
                    <artifactId>netty</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-features-clustering</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-policy</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>jaxb-core</artifactId>
                    <groupId>com.sun.xml.bind</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jaxb-impl</artifactId>
                    <groupId>com.sun.xml.bind</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>slf4j-api</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cxf-rt-bindings-soap</artifactId>
                    <groupId>org.apache.cxf</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>camel-cxf-transport</artifactId>
                    <groupId>org.apache.camel</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>camel-http-common</artifactId>
                    <groupId>org.apache.camel</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>camel-spring</artifactId>
                    <groupId>org.apache.camel</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cxf-core</artifactId>
                    <groupId>org.apache.cxf</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cxf-rt-transports-http</artifactId>
                    <groupId>org.apache.cxf</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>javax.annotation-api</artifactId>
                    <groupId>javax.annotation</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>javax.ws.rs-api</artifactId>
                    <groupId>javax.ws.rs</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cxf-rt-frontend-jaxws</artifactId>
                    <groupId>org.apache.cxf</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cxf-rt-rs-client</artifactId>
                    <groupId>org.apache.cxf</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>javax.servlet-api</artifactId>
                    <groupId>javax.servlet</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-beans</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-context</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-core</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>
		<!-- Test dependencies -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
			<scope>test</scope>
        </dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.easymock</groupId>
			<artifactId>easymock</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-library</artifactId>
			<scope>test</scope>
		</dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

	<build>
		<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-xjc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>xsdtojava</goal>
                        </goals>
                        <configuration>
                            <xsdOptions>
                                <xsdOption>
                                    <xsd>${basedir}/src/main/resources/schemas/locator-endpoint.xsd</xsd>
                                    <bindingFile>${basedir}/src/main/resources/schemas/locator-endpoint.xjb</bindingFile>
									<catalog>${basedir}/src/main/build-resources/catalog.cat</catalog>
                                    <extensionArgs>
                                        <arg>-encoding</arg>
                                        <arg>UTF-8</arg>
                                    </extensionArgs>
                                </xsdOption>
                                <xsdOption>
                                    <xsd>${basedir}/src/main/resources/schemas/ws-addr.xsd</xsd>
                                    <bindingFile>${basedir}/src/main/resources/schemas/ws-addr.xjb</bindingFile>
                                    <extensionArgs>
                                        <arg>-encoding</arg>
                                        <arg>UTF-8</arg>
                                    </extensionArgs>
                                </xsdOption>
                            </xsdOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <configuration>
                    <obrRepository>NONE</obrRepository>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Export-Package>
                            org.talend.esb.servicelocator.*;version="${project.version}",
                            '=META-INF.tesb.locator'
                        </Export-Package>
                        <Export-Service>
                            org.talend.esb.servicelocator.client.ServiceLocator,
                            org.talend.esb.servicelocator.client.ExpiredEndpointCollector,
                            org.talend.esb.servicelocator.cxf.LocatorFeature
                        </Export-Service>
                    </instructions>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.aries.blueprint</groupId>
                <artifactId>blueprint-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>blueprint-generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <scanPaths>
                        <scanPath>org.talend.esb.servicelocator</scanPath>
                    </scanPaths>
                    <excludeArtifacts>
                        <excludeArtifact>.*</excludeArtifact>
                    </excludeArtifacts>
                </configuration>
            </plugin>
            <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>etc/org.talend.esb.locator.cfg</file>
                                    <type>cfg</type>
                                    <classifier>org.talend.esb.locator</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
		</plugins>
	</build>
</project>
