5757 <artifactId >jol-core</artifactId >
5858 <version >${jol-core.version} </version >
5959 </dependency >
60+ <dependency > <!-- needed to bridge to slf4j for projects that use the log4j APIs directly -->
61+ <groupId >org.slf4j</groupId >
62+ <artifactId >log4j-over-slf4j</artifactId >
63+ <version >${org.slf4j.version} </version >
64+ </dependency >
6065 </dependencies >
6166
6267 <properties >
6671 <asm .version>8.0.1</asm .version>
6772 <bcel .version>6.5.0</bcel .version>
6873 </properties >
74+ <profiles >
75+ <!-- java instrumentation profiles to build jars -->
76+ <profile >
77+ <id >buildAgentLoader</id >
78+ <build >
79+ <plugins >
80+ <plugin >
81+ <groupId >org.apache.maven.plugins</groupId >
82+ <artifactId >maven-jar-plugin</artifactId >
83+ <executions >
84+ <execution >
85+ <phase >package</phase >
86+ <goals >
87+ <goal >jar</goal >
88+ </goals >
89+ <configuration >
90+ <classifier >agentLoader</classifier >
91+ <classesDirectory >target/classes</classesDirectory >
92+ <archive >
93+ <manifest >
94+ <addClasspath >true</addClasspath >
95+ <mainClass >com.baeldung.instrumentation.application.Launcher</mainClass >
96+ </manifest >
97+ <manifestFile >${project.build.outputDirectory} /META-INF/MANIFEST.MF</manifestFile >
98+ </archive >
99+
100+ <includes >
101+ <include >com/baeldung/instrumentation/application/AgentLoader.class</include >
102+ <include >com/baeldung/instrumentation/application/Launcher.class</include >
103+ </includes >
104+ </configuration >
105+ </execution >
106+ </executions >
107+ </plugin >
108+ </plugins >
109+ </build >
110+ </profile >
111+ <profile >
112+ <id >buildApplication</id >
113+ <build >
114+ <plugins >
115+ <plugin >
116+ <groupId >org.apache.maven.plugins</groupId >
117+ <artifactId >maven-jar-plugin</artifactId >
118+ <executions >
119+ <execution >
120+ <phase >package</phase >
121+ <goals >
122+ <goal >jar</goal >
123+ </goals >
124+ <configuration >
125+ <classifier >application</classifier >
126+ <classesDirectory >target/classes</classesDirectory >
127+ <archive >
128+ <manifest >
129+ <addClasspath >true</addClasspath >
130+ <mainClass >com.baeldung.instrumentation.application.Launcher</mainClass >
131+ </manifest >
132+ <manifestFile >${project.build.outputDirectory} /META-INF/MANIFEST.MF</manifestFile >
133+ </archive >
134+
135+ <includes >
136+ <include >com/baeldung/instrumentation/application/MyAtm.class</include >
137+ <include >com/baeldung/instrumentation/application/MyAtmApplication.class</include >
138+ <include >com/baeldung/instrumentation/application/Launcher.class</include >
139+ </includes >
140+ </configuration >
141+ </execution >
142+ </executions >
143+ </plugin >
144+ </plugins >
145+ </build >
146+ </profile >
147+ <profile >
148+ <id >buildAgent</id >
149+ <build >
150+ <plugins >
151+ <plugin >
152+ <groupId >org.apache.maven.plugins</groupId >
153+ <artifactId >maven-jar-plugin</artifactId >
154+ <executions >
155+ <execution >
156+ <phase >package</phase >
157+ <goals >
158+ <goal >jar</goal >
159+ </goals >
160+ <configuration >
161+ <classifier >agent</classifier >
162+ <classesDirectory >target/classes</classesDirectory >
163+ <archive >
164+ <manifest >
165+ <addClasspath >true</addClasspath >
166+ <mainClass >com.baeldung.instrumentation.application.Launcher</mainClass >
167+ </manifest >
168+ <manifestFile >${project.build.outputDirectory} /META-INF/MANIFEST.MF</manifestFile >
169+ </archive >
170+
171+ <includes >
172+ <include >com/baeldung/instrumentation/agent/AtmTransformer.class</include >
173+ <include >com/baeldung/instrumentation/agent/MyInstrumentationAgent.class</include >
174+ </includes >
175+ </configuration >
176+ </execution >
177+ </executions >
178+ </plugin >
179+ </plugins >
180+ </build >
181+ </profile >
182+ </profiles >
69183
70184</project >
0 commit comments