<!--

 Copyright (c) 2011 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>esb-parent</artifactId>
		<version>6.3.2</version>
        <relativePath>../pom.xml</relativePath>
	</parent>

	<dependencies>
		<dependency>
			<groupId>org.apache.zookeeper</groupId>
			<artifactId>zookeeper</artifactId>
			<version>${zookeeper.version}</version>
			<exclusions>
				<exclusion>
					<groupId>jline</groupId>
					<artifactId>jline</artifactId>
				</exclusion>
				<exclusion>
					<groupId>io.netty</groupId>
					<artifactId>netty</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-features-clustering</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-policy</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-security</artifactId>
            <version>${cxf.version}</version>
        </dependency>
		<!-- Test dependencies -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-client</artifactId>
            <version>${cxf.version}</version>
			<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>
	</dependencies>

	<build>
		<plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-xjc-plugin</artifactId>
                <version>${cxf.xjc-utils.version}</version>
                <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>
                                </xsdOption>
                                <xsdOption>
                                    <xsd>${basedir}/src/main/resources/schemas/ws-addr.xsd</xsd>
                                    <bindingFile>${basedir}/src/main/resources/schemas/ws-addr.xjb</bindingFile>
                                </xsdOption>
                            </xsdOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<configuration>
					<instructions>
						<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
						<Export-Package>
							org.talend.esb.servicelocator.*, 
							'=META-INF.tesb.locator'
                        </Export-Package>
                        <Import-Package>
                            *
                            ,org.springframework.beans.factory.config
                            ,org.apache.cxf.bus.spring
                        </Import-Package>
                        <Export-Service>
                            org.talend.esb.servicelocator.client.ServiceLocator,
                            org.talend.esb.servicelocator.client.ExpiredEndpointCollector,
                            org.talend.esb.servicelocator.cxf.internal.ServiceLocatorManager,
                            org.talend.esb.servicelocator.cxf.LocatorFeatureInterface
                        </Export-Service>
						<_failok>true</_failok>
                        <_nouses>true</_nouses>
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<includeScope>runtime</includeScope>
						</configuration>
					</execution>
				</executions>
            </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>
