<!--
    	Copyright 2016 ContainX and OpenStack4j                                          
    	                                                                                 
    	Licensed under the Apache License, Version 2.0 (the "License"); you may not      
    	use this file except in compliance with the License. You may obtain a copy of    
    	the License at                                                                   
    	                                                                                 
    	    http://www.apache.org/licenses/LICENSE-2.0                                   
    	                                                                                 
    	Unless required by applicable law or agreed to in writing, software              
    	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT        
    	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the         
    	License for the specific language governing permissions and limitations under    
    	the License.                                                                     
 --> 
<!--
 -->
<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>com.huawei</groupId>
		<artifactId>openstack4j-parent</artifactId>
		<version>1.0.17</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>openstack4j-core</artifactId>
	<name>OpenStack4j Core</name>
	<description>OpenStack Java API</description>
	<url>http://github.com/ContainX/openstack4j/</url>
	<packaging>jar</packaging>

	<build>
		<finalName>openstack4j-core</finalName>
		<plugins>
			<!-- 
			<plugin>
				<groupId>org.projectlombok</groupId>
				<artifactId>lombok-maven-plugin</artifactId>
				<version>1.16.18.0</version>
				<executions>
					<execution>
						<id>delombok</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>delombok</goal>
						</goals>
						<configuration>
							<addOutputDirectory>false</addOutputDirectory>
							<sourceDirectory>src/main/java</sourceDirectory>
						</configuration>
					</execution>
					<execution>
						<id>test-delombok</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>testDelombok</goal>
						</goals>
						<configuration>
							<addOutputDirectory>false</addOutputDirectory>
							<sourceDirectory>src/test/java</sourceDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>1.3.3</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<minimizeJar>true</minimizeJar>
							<shadedArtifactAttached>true</shadedArtifactAttached>
							<!-- 
							<createSourcesJar>true</createSourcesJar>
							-->
							<shadedClassifierName>withdeps</shadedClassifierName>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-Name>${project.name}</Bundle-Name>
						<Export-Package>
							<!-- core.transport.internal is imported by jersey2 connector! -->
							<!-- !com.huawei.openstack4j.core.transport.internal, -->
							!com.huawei.openstack4j.openstack.compute.internal,
							!com.huawei.openstack4j.openstack.compute.internal.ext,
							!com.huawei.openstack4j.openstack.heat.internal,
							!com.huawei.openstack4j.openstack.identity.internal,
							!com.huawei.openstack4j.openstack.image.internal,
							<!-- openstack.internal is imported by connectors! -->
							<!-- !com.huawei.openstack4j.openstack.internal, -->
							<!-- logging.internal is imported by logging plugins! -->
							<!-- !com.huawei.openstack4j.openstack.logging.internal, -->
							!com.huawei.openstack4j.openstack.networking.internal,
							!com.huawei.openstack4j.openstack.networking.internal.ext,
							!com.huawei.openstack4j.openstack.storage.block.internal,
							!com.huawei.openstack4j.openstack.storage.object.internal,
							!com.huawei.openstack4j.openstack.telemetry.internal,
							com.huawei.openstack4j,
							com.huawei.openstack4j.*
						</Export-Package>
						<Private-Package>
							com.huawei.openstack4j.openstack.compute.internal,
							com.huawei.openstack4j.openstack.compute.internal.ext,
							com.huawei.openstack4j.openstack.heat.internal,
							com.huawei.openstack4j.openstack.identity.internal,
							com.huawei.openstack4j.openstack.image.internal,
							com.huawei.openstack4j.openstack.networking.internal,
							com.huawei.openstack4j.openstack.networking.internal.ext,
							com.huawei.openstack4j.openstack.storage.block.internal,
							com.huawei.openstack4j.openstack.storage.object.internal,
							com.huawei.openstack4j.openstack.telemetry.internal
						</Private-Package>
						<Import-Package>
							!org.openstack*,
							!com.fasterxml.jackson.dataformat.yaml.snakeyaml,
							*
						</Import-Package>
						<!-- Required for SPI in OSGi: http://aries.apache.org/modules/spi-fly.html#specconf This bundles uses SPI to locate 
							implementations for: com.huawei.openstack4j.api.APIProvider com.huawei.openstack4j.core.transport.HttpExecutorService com.huawei.openstack4j.openstack.logging.LoggerFactorySupplier 
							This bundle defines an implementation for following services in META-INF-services: com.huawei.openstack4j.api.APIProvider -->
						<Require-Capability>
							osgi.serviceloader;
							filter:="(osgi.serviceloader=com.huawei.openstack4j.api.APIProvider)";cardinality:=multiple,
							osgi.serviceloader;
							filter:="(osgi.serviceloader=com.huawei.openstack4j.core.transport.HttpExecutorService)";cardinality:=multiple,
							osgi.serviceloader;
							filter:="(osgi.serviceloader=com.huawei.openstack4j.openstack.logging.LoggerFactorySupplier)";cardinality:=multiple;resolution:=optional,
							osgi.extender; filter:="(osgi.extender=osgi.serviceloader.processor)",
							osgi.extender;
							filter:="(osgi.extender=osgi.serviceloader.registrar)"
						</Require-Capability>
						<Provide-Capability>
							osgi.serviceloader; osgi.serviceloader=com.huawei.openstack4j.api.APIProvider
						</Provide-Capability>
						<Embed-Transitive>
							true
						</Embed-Transitive>
						<Embed-Dependency>
							jackson-dataformat-yaml
						</Embed-Dependency>
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<annotationProcessorPaths>
						<path>
							<groupId>org.projectlombok</groupId>
							<artifactId>lombok</artifactId>
							<version>${lombok.version}</version>
						</path>
					</annotationProcessorPaths>
                </configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.5</version>
					<!-- Build jar with specified name and including the OSGi-ready manifest -->
					<configuration>
						<finalName>${project.artifactId}-${release.version}</finalName>
						<!-- Take manifest generated by maven-bundle-plugin -->
						<archive>
							<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
						</archive>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.felix</groupId>
					<artifactId>maven-bundle-plugin</artifactId>
					<version>2.5.3</version>
					<executions>
						<!-- Generate bundle manifest -->
						<execution>
							<id>bundle-manifest</id>
							<phase>process-classes</phase>
							<goals>
								<goal>manifest</goal>
							</goals>
							<configuration>
								<instructions>
									<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
								</instructions>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.felix
										</groupId>
										<artifactId>
											maven-bundle-plugin
										</artifactId>
										<versionRange>
											[2.5.3,)
										</versionRange>
										<goals>
											<goal>manifest</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<dependencies>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.dataformat</groupId>
			<artifactId>jackson-dataformat-yaml</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.code.findbugs</groupId>
			<artifactId>jsr305</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
		</dependency>
		<dependency>
			<groupId>com.github.fge</groupId>
			<artifactId>json-patch</artifactId>
		</dependency>
		<dependency>
			<groupId>org.testng</groupId>
			<artifactId>testng</artifactId>
			<scope>test</scope>
		</dependency>
    </dependencies>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9.1</version>
				<configuration>
					<author>true</author>
					<protected>true</protected>
					<reportOutputDirectory>docs</reportOutputDirectory>
					<destDir>javadoc</destDir>
					<additionalparam>-Xdoclint:none</additionalparam>
				</configuration>
			</plugin>
		</plugins>
	</reporting>
</project>
