-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpom.xml
90 lines (83 loc) · 3.98 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
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<iast.version>1.0</iast.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<groupId>com.keven1z</groupId>
<artifactId>simpleIAST</artifactId>
<packaging>pom</packaging>
<version>${iast.version}</version>
<modules>
<module>engine</module>
<module>agent</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version> <!-- 使用最新版本 -->
<executions>
<execution>
<id>git-commit-id</id>
<goals>
<goal>revision</goal> <!-- 获取 Git 提交信息 -->
</goals>
<phase>validate</phase> <!-- 在 validate 阶段执行 -->
<configuration>
<failOnNoGitDirectory>false</failOnNoGitDirectory> <!-- 如果没有 Git 仓库则不失败 -->
<prefix>git</prefix> <!-- 设置前缀,防止与其他 Maven 变量冲突 -->
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<encoding>UTF-8</encoding>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase> <!-- 在 package 阶段执行 -->
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Project-Version>${project.version}</Project-Version>
<Git-Commit>${git.commit.id.abbrev}</Git-Commit> <!-- 简短提交哈希 -->
<Git-Branch>${git.branch}</Git-Branch> <!-- 当前 Git 分支 -->
<Last-Commit-User-Name>${git.commit.user.name}
</Last-Commit-User-Name> <!-- 提交者用户名 -->
<Last-Commit-User-Email>${git.commit.user.email}
</Last-Commit-User-Email> <!-- 提交者邮箱 -->
<Build-Time>${maven.build.timestamp}</Build-Time>
<Build-By>keven1z</Build-By>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>