-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpom.xml
54 lines (49 loc) · 2.28 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
<?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>
<groupId>cn.loveshisong.sizeof</groupId>
<artifactId>sizeof</artifactId>
<version>0.1</version>
<build>
<plugins>
<!-- maven 打包插件, 可指定生成的 META-INF/manifest.mf 文件中的属性 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<!-- 生成 manifest.mf 时添加的属性 -->
<manifestEntries>
<Premain-Class>cn.loveshisong.sizeof.SizeOf</Premain-Class>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
</manifestEntries>
</archive>
</configuration>
</plugin>
<!-- 测试运行器(Test Runner), 执行到特定生命周期阶段的时候,通过该插件来执行JUnit或者TestNG的测试用例 -->
<!-- maven-surefire-plugin 在test时默认执行 src/test/java/ 下所有名为*Test.java和*TestCase.java的测试类 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>pertest</forkMode>
<!-- argLine指定了VM运行参数 -->
<argLine>-javaagent:${basedir}/target/sizeof-${project.version}.jar</argLine>
<workingDirectory>${basedir}/target</workingDirectory>
<useSystemClassLoader>true</useSystemClassLoader>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>