-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
141 lines (135 loc) · 4.22 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<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>
<groupId>cn.liu.hui.peng</groupId>
<artifactId>simple-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>simple-server</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.rabbitmq</groupId>
<artifactId>amqp-client</artifactId>
<version>4.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<version>1.5.3.RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 配置文件 -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy-resources</id>
<!-- here the phase you need -->
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!-- 输入文件路径 -->
<outputDirectory>${basedir}/project/</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
<!--需要打包的内容 -->
<includes>
<include>conf/env/**</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<!-- 排除的内容 -->
<excludes>
<exclude>conf/xml/**</exclude>
</excludes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- 用于拷贝maven依赖的plugin yes -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>copy</id><!-- copy-dependencies -->
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- 把依赖的所有maven jar包拷贝到lib目录中(这样所有的jar包都在lib目录中) -->
<outputDirectory>${basedir}/project/lib</outputDirectory>
<!-- jar依赖的jar是否包含,一般都是需要的所以false -->
<excludeTransitive>false</excludeTransitive>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<!-- 源码文件 执行 mvn install,maven会自动将source install到repository 。 执行 mvn deploy,maven会自动将source
deploy到remote-repository 。 执行 mvn source:jar,单独打包源码 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>package</phase>
<!-- <phase>verify</phase> -->
<goals>
<!-- <goal>jar</goal> -->
<goal>jar-no-fork</goal><!-- 只会在phase期间 -->
</goals>
</execution>
</executions>
<configuration>
<!-- <outputDirectory>${basedir}/project/lib</outputDirectory> -->
</configuration>
</plugin>
<!-- 项目打包 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<!-- 下面那个可以见jar移动到指定的目录 -->
<executions>
<execution>
<id>aaa-jar</id><!-- default-jar -->
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>${project.version}</classifier>
<!-- <jarName>${project.artifactId}</jarName> -->
<outputDirectory>${basedir}/project/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>