Skip to content

Commit c3a1a08

Browse files
authored
build: changing packaging based on active profile in pom (#259)
1 parent 5af43ab commit c3a1a08

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,20 @@ AREX utilizes the advanced Java technique, Instrument API, and is capable of ins
6060
## Installation
6161

6262

63-
Simply download the latest binary from [github](https://github.com/arextest/releases) or compile it by yourself.
63+
Simply download the latest binary from [github](https://github.com/arextest/arex-agent-java/releases)
64+
or compile it with `mvn clean package -DskipTests` by yourself.
6465

6566
There are two agent files provided in the arex-agent-jar folder like below. They must be placed in the same directory.
6667

68+
```other
69+
arex-agent.jar
70+
arex-agent-bootstrap.jar
71+
```
72+
73+
If you need these jar with version, you can add option: `mvn clean package -DskipTests -Pjar-with-version`
6774
```other
6875
arex-agent-<version>.jar
6976
arex-agent-bootstrap-<version>.jar
70-
7177
```
7278

7379

@@ -81,7 +87,7 @@ AREX agent works along with the [AREX storage service](https://github.com/arexte
8187
You could just configure the host and port of them respectively, like below
8288

8389
```other
84-
java -javaagent:/path/to/arex-agent-<version>.jar
90+
java -javaagent:/path/to/arex-agent.jar
8591
-Darex.service.name=your-service-name
8692
-Darex.storage.service.host=[storage.service.host:port](storage.service.host:port)
8793
-jar your-application.jar
@@ -99,7 +105,7 @@ arex.storage.service.host=<storage.service.host:port>
99105
Then simply run:
100106

101107
```other
102-
java -javaagent:/path/to/arex-agent-<version>.jar
108+
java -javaagent:/path/to/arex-agent.jar
103109
-Darex.config.path=/path/to/arex.agent.conf
104110
-jar your-application.jar
105111
```

arex-agent/pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@
190190
</dependencies>
191191

192192
<build>
193-
<finalName>arex-agent-${project.version}</finalName>
194193
<plugins>
195194
<plugin>
196195
<groupId>org.apache.maven.plugins</groupId>
@@ -204,7 +203,6 @@
204203
<configuration>
205204
<archive>
206205
<manifest>
207-
<addClasspath>true</addClasspath>
208206
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
209207
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
210208
</manifest>
@@ -216,6 +214,7 @@
216214
<Can-Set-Native-Method-Prefix>true</Can-Set-Native-Method-Prefix>
217215
<Build-Time>${maven.build.timestamp}</Build-Time>
218216
<Built-By>arextest.com</Built-By>
217+
<Class-Path>${bootStrapJarName}</Class-Path>
219218
</manifestEntries>
220219
</archive>
221220
</configuration>
@@ -279,8 +278,8 @@
279278
<fileset dir="../arex-agent-jar/bytecode-dump" includes="*.class" />
280279
</delete>
281280
<copy todir="../arex-agent-jar">
282-
<fileset dir="../arex-agent/target/" includes="arex-agent-*.jar" />
283-
<fileset dir="../arex-agent-bootstrap/target/" includes="arex-agent-bootstrap-*.jar" />
281+
<fileset dir="../arex-agent/target/" includes="arex-agent*.jar" />
282+
<fileset dir="../arex-agent-bootstrap/target/" includes="arex-agent-bootstrap*.jar" />
284283
</copy>
285284
</target>
286285
</configuration>

pom.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,28 @@
208208
</dependency>
209209
</dependencies>
210210

211+
<profiles>
212+
<profile>
213+
<id>default</id>
214+
<properties>
215+
<jarName>${project.artifactId}</jarName>
216+
<bootStrapJarName>arex-agent-bootstrap.${project.packaging}</bootStrapJarName>
217+
</properties>
218+
<activation>
219+
<activeByDefault>true</activeByDefault>
220+
</activation>
221+
</profile>
222+
<profile>
223+
<id>jar-with-version</id>
224+
<properties>
225+
<jarName>${project.artifactId}-${project.version}</jarName>
226+
<bootStrapJarName>arex-agent-bootstrap-${project.version}.${project.packaging}</bootStrapJarName>
227+
</properties>
228+
</profile>
229+
</profiles>
230+
211231
<build>
232+
<finalName>${jarName}</finalName>
212233
<plugins>
213234
<plugin>
214235
<groupId>org.apache.maven.plugins</groupId>

0 commit comments

Comments
 (0)