liurunyu
5 天以前 9fa83843558990ea495e1bd4b1cbf667b810fdb5
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
<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
 
    <parent>
        <artifactId>pipIrr-web</artifactId>
        <groupId>com.dy</groupId>
        <version>1.0.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
 
    <packaging>jar</packaging>
    <artifactId>pipIrr-web-remote</artifactId>
    <name>pipIrr-web-remote</name>
    <description>web远程操作信息系统</description>
 
    <build>
        <plugins>
            <!-- 生成不包含依赖jar的可执行jar包
            <plugin>
                !- spring boot提供的maven打包插件 -
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        !-
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        -
                        <configuration>
                            !- 不加的话最终包名为: ${artifactId}-${version}.jar, 加了的话最终包名: ${artifactId}-${version}-${classifier}.jar  -
                            <classifier>execute</classifier>
                            !- 不指定生成路径的话, 默认保存在 ${build.directory} 下 -
                            <outputDirectory>${project.build.directory}/execute</outputDirectory>
                            <finalName>${artifactId}-${version}</finalName>
                            <layout>ZIP</layout>
                            <mainClass>com.dy.pipIrrBase.PipIrrBaseApplication</mainClass>
                            <includes>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-common</artifactId>
                                </include>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-global</artifactId>
                                </include>
                            </includes>
                            <excludes>
                                <exclude>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                </exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
 
            </plugin>
            -->
            <!-- 拷贝依赖的jar包到lib目录-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <configuration>
                            <!-- 不加的话最终包名为: ${artifactId}-${version}.jar, 加了的话最终包名: ${artifactId}-${version}-${classifier}.jar
                            <classifier>execute</classifier>
                            -->
                            <!-- ${project.build.directory}是maven变量,内置的,表示target目录,如果不写,将在根目录下创建/lib -->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <!-- excludeTransitive:是否不包含间接依赖包,比如我们依赖A,但是A又依赖了B,我们是否也要把B打进去 默认不打-->
                            <excludeTransitive>false</excludeTransitive>
                            <!-- 复制的jar文件去掉版本信息 -->
                            <stripVersion>false</stripVersion>
                            <finalName>${project.artifactId}-${project.version}</finalName>
                            <layout>ZIP</layout>
                            <mainClass>com.dy.pipIrrRemote.PipIrrRemoteApplication</mainClass>
                            <includes>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-common</artifactId>
                                </include>
                                <include>
                                    <groupId>com.dy</groupId>
                                    <artifactId>pipIrr-global</artifactId>
                                </include>
                            </includes>
                            <excludes>
                                <exclude>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                </exclude>
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
 
            <plugin>
                <!-- 设置java编译版本,运行环境版本 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- source: 源代码编译版本;target: 目标平台编译版本;encoding: 字符集编码。 -->
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- 解决资源文件的编码问题 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <!-- maven里执行测试用例的插件 -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skipTests>true</skipTests>
                </configuration>
            </plugin>
            <plugin>
                <!-- 下面解决:当进行Maven Lifecycle package时报错:Could not find artifact org.apache.mina:mina-core:bundle:2.2.1 in maven (https://repo1.maven.org/maven2/)-->
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
            </plugin>
        </plugins>
    </build>
</project>