<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2017 Huawei Technologies Co., Ltd
  ~
  ~ 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">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>io.servicecomb</groupId>
		<artifactId>java-chassis</artifactId>
		<version>0.1.0</version>
	</parent>
	<groupId>io.servicecomb.demo</groupId>
	<artifactId>demo-parent</artifactId>
	<packaging>pom</packaging>
	<modules>
		<module>docker-build-config</module>
		<module>docker-run-config</module>
		<module>demo-local</module>
		<module>demo-server-servlet</module>
		<module>demo-pojo</module>
		<module>demo-jaxrs</module>
		<module>demo-perf-client</module>
		<module>demo-springmvc</module>
		<module>demo-schema</module>
		<module>demo-crossapp</module>
		<module>demo-spring-boot-provider</module>
		<module>demo-spring-boot-transport</module>
		<module>demo-spring-boot-discovery</module>
		<module>demo-multiple</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>demo-schema</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>all-client</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>pojo-server</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>jaxrs-server</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>springmvc-server</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>crossapp-server</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>multiple-server</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>multiple-client</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>pojo-client</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>jaxrs-client</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>springmvc-client</artifactId>
				<version>0.1.0</version>
			</dependency>
			<dependency>
				<groupId>io.servicecomb.demo</groupId>
				<artifactId>crossapp-client</artifactId>
				<version>0.1.0</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>
	</dependencies>
 
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.github.odavid.maven.plugins</groupId>
					<artifactId>mixin-maven-plugin</artifactId>
					<version>0.1-alpha-39</version>
					<extensions>true</extensions>
				</plugin>
				<plugin>
					<groupId>org.commonjava.maven.plugins</groupId>
					<artifactId>directory-maven-plugin</artifactId>
					<version>0.1</version>
				</plugin>
				<plugin>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
					<configuration>
						<skip>true</skip>
					</configuration>
				</plugin>
				<plugin>
					<artifactId>maven-install-plugin</artifactId>
					<version>2.5.2</version>
					<configuration>
						<skip>false</skip>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.6</version>
					<executions>
						<execution>
							<id>assembly</id>
							<phase>package</phase>
						</execution>
					</executions>
					<configuration>
						<archive>
							<manifest>
								<addClasspath>true</addClasspath>
								<classpathPrefix>lib/</classpathPrefix>
								<mainClass>${demo.main}</mainClass>
							</manifest>
						</archive>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	
	<profiles>
		<profile>
			<id>demo-run-release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.commonjava.maven.plugins</groupId>
						<artifactId>directory-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>directoryies</id>
								<goals>
									<goal>directory-of</goal>
								</goals>
								<phase>initialize</phase>
								<configuration>
									<property>root.dir</property>
									<project>
										<groupId>io.servicecomb</groupId>
										<artifactId>java-chassis</artifactId>
									</project>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-jar-plugin</artifactId>
							<configuration>
								<outputDirectory>${demo.run.dir}/${project.name}</outputDirectory>
								<archive>
									<manifest>
										<addClasspath>true</addClasspath>
										<classpathPrefix>../lib/</classpathPrefix>
										<mainClass>${demo.main}</mainClass>
									</manifest>
									<manifestEntries>
										<Class-Path>. ..</Class-Path>
									</manifestEntries>
								</archive>
							</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>
										<outputDirectory>${demo.run.dir}/lib</outputDirectory>
									</configuration>
								</execution>
							</executions>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
			<properties>
				<demo.run.dir>${root.dir}/demo/target</demo.run.dir>
			</properties>
		</profile>
	</profiles>
</project>