<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.sibu.orderHelper</groupId>
    <artifactId>com.sibu.orderHelper</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <groupId>com.sibu.orderHelper.logService</groupId>
  <artifactId>com.sibu.orderHelper.logService</artifactId>
  <name>com.sibu.orderHelper.logService</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.deploy.directory.logService>log_service/app</project.deploy.directory.logService>
  </properties>
  <dependencies>
    <dependency>
			<groupId>com.sibu.orderHelper.service</groupId>
			<artifactId>com.sibu.orderHelper.service</artifactId>
			<version>0.0.1-SNAPSHOT</version>
	</dependency>
	<dependency>
			<groupId>com.sibu.orderHelper.activeMQ</groupId>
			<artifactId>com.sibu.orderHelper.activeMQ</artifactId>
			<version>0.0.1-SNAPSHOT</version>
	</dependency> 
	<dependency>
			<groupId>net.sourceforge.jtds</groupId>
			<artifactId>jtds</artifactId>
			<version>1.2.4</version>
	</dependency>
	<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.10</version>
			<scope>test</scope>
	</dependency>

  </dependencies>

  
  <build>
		<finalName>com.sibu.orderHelper.logService</finalName>
		<plugins>
			<plugin>  
		        <groupId>org.apache.maven.plugins</groupId>  
		        <artifactId>maven-surefire-plugin</artifactId>  
		        <version>2.18.1</version>  
		        <configuration>  
		          <skipTests>true</skipTests>  
		        </configuration>  
      		</plugin> 
      		 <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<finalName>${project.artifactId}-${project.version}</finalName>
					<outputDirectory>${project.build.directory}/${project.deploy.directory.logService}/lib</outputDirectory>
			<!-- 	暂时不用java -jar 方法运行main方法,直接通过脚本运行 	 
				<archive>  
	            		<manifest>  
		                	<addClasspath>true</addClasspath>  
		                	<classpathPrefix>./</classpathPrefix>  
		                	<mainClass>org.com.sibu.orderHelper.logService.LogServiceMain</mainClass>  
            			</manifest>  
        		</archive>  -->
	        	<excludes>
						<exclude>**/*.properties</exclude>
						<exclude>**/*.conf</exclude>
						<exclude>**/*.xml</exclude>
				</excludes>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<phase>validate</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<encoding>utf8</encoding>
							<outputDirectory>${project.build.directory}/${project.deploy.directory.logService}/lib</outputDirectory>
							<silent>true</silent>
						</configuration>
					</execution>
				</executions>
			</plugin> 
			<!-- 资源文件复制 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<configuration>
						<encoding>UTF-8</encoding>
				</configuration>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<encoding>UTF-8</encoding>
							<includeEmptyDirs>true</includeEmptyDirs>
							<outputDirectory>${project.build.directory}/${project.deploy.directory.logService}/config</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/src/main/resources</directory>
									<filtering>false</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-folder</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<encoding>UTF-8</encoding>
							<outputDirectory>${project.build.directory}/${project.deploy.directory.logService}</outputDirectory>
							<includeEmptyDirs>true</includeEmptyDirs>
							<resources>
								<resource>
									<directory>src/log_service</directory>
									<filtering>false</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin> 
			<!-- 利用shade插件打包直接运行java -jar 命令就可以运行主程序 -->
<!-- 			<plugin>  
    			<groupId>org.apache.maven.plugins</groupId>  
    			<artifactId>maven-shade-plugin</artifactId>
    			<version>2.4.3</version> 
	   			<configuration>
	   				<finalName>log-service</finalName>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <transformers>
				         <transformer implementation = "org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">  
				         <mainClass>org.com.sibu.orderHelper.logService.LogServiceMain</mainClass>  
				         </transformer>  
				     <transformer  
                        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">  
                        <resource>META-INF/spring.handlers</resource>  
                    </transformer> 
                    <transformer  
                        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">  
                        <resource>META-INF/spring.schemas</resource>  
                    </transformer>  
                    </transformers>
                </configuration>  
                <executions>  
                    <execution>  
                        <phase>package</phase>  
                        <goals>  
                            <goal>shade</goal>  
                        </goals>  
                    </execution>  
                </executions>  
	          </plugin> -->
      	</plugins>
  </build>
</project>