|
66 | 66 | </executions> |
67 | 67 | </plugin> |
68 | 68 |
|
69 | | - <plugin> |
70 | | - <groupId>org.apache.maven.plugins</groupId> |
71 | | - <artifactId>maven-jar-plugin</artifactId> |
72 | | - <version>${maven-jar-plugin.version}</version> |
73 | | - <configuration> |
74 | | - <archive> |
75 | | - <manifest> |
76 | | - <addClasspath>true</addClasspath> |
77 | | - <classpathPrefix>libs/</classpathPrefix> |
78 | | - <mainClass>com.baeldung.executable.ExecutableMavenJar</mainClass> |
79 | | - </manifest> |
80 | | - </archive> |
81 | | - </configuration> |
82 | | - </plugin> |
83 | | - |
84 | | - <plugin> |
85 | | - <groupId>org.apache.maven.plugins</groupId> |
86 | | - <artifactId>maven-assembly-plugin</artifactId> |
87 | | - <executions> |
88 | | - <execution> |
89 | | - <phase>package</phase> |
90 | | - <goals> |
91 | | - <goal>single</goal> |
92 | | - </goals> |
93 | | - <configuration> |
94 | | - <archiveBaseDirectory>${project.basedir}</archiveBaseDirectory> |
95 | | - <archive> |
96 | | - <manifest> |
97 | | - <mainClass>com.baeldung.executable.ExecutableMavenJar</mainClass> |
98 | | - </manifest> |
99 | | - </archive> |
100 | | - <descriptorRefs> |
101 | | - <descriptorRef>jar-with-dependencies</descriptorRef> |
102 | | - </descriptorRefs> |
103 | | - </configuration> |
104 | | - </execution> |
105 | | - </executions> |
106 | | - </plugin> |
107 | | - |
108 | | - <plugin> |
109 | | - <groupId>org.apache.maven.plugins</groupId> |
110 | | - <artifactId>maven-shade-plugin</artifactId> |
111 | | - <version>${maven-shade-plugin.version}</version> |
112 | | - <executions> |
113 | | - <execution> |
114 | | - <goals> |
115 | | - <goal>shade</goal> |
116 | | - </goals> |
117 | | - <configuration> |
118 | | - <shadedArtifactAttached>true</shadedArtifactAttached> |
119 | | - <transformers> |
120 | | - <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> |
121 | | - <mainClass>com.baeldung.executable.ExecutableMavenJar</mainClass> |
122 | | - </transformer> |
123 | | - </transformers> |
124 | | - </configuration> |
125 | | - </execution> |
126 | | - </executions> |
127 | | - </plugin> |
128 | | - |
129 | | - <plugin> |
130 | | - <groupId>com.jolira</groupId> |
131 | | - <artifactId>onejar-maven-plugin</artifactId> |
132 | | - <version>${onejar-maven-plugin.version}</version> |
133 | | - <executions> |
134 | | - <execution> |
135 | | - <configuration> |
136 | | - <mainClass>com.baeldung.executable.ExecutableMavenJar</mainClass> |
137 | | - <attachToBuild>true</attachToBuild> |
138 | | - <filename>${project.build.finalName}-onejar.${project.packaging}</filename> |
139 | | - </configuration> |
140 | | - <goals> |
141 | | - <goal>one-jar</goal> |
142 | | - </goals> |
143 | | - </execution> |
144 | | - </executions> |
145 | | - </plugin> |
146 | | - |
147 | | - <plugin> |
148 | | - <groupId>org.springframework.boot</groupId> |
149 | | - <artifactId>spring-boot-maven-plugin</artifactId> |
150 | | - <version>${spring-boot-maven-plugin.version}</version> |
151 | | - <executions> |
152 | | - <execution> |
153 | | - <goals> |
154 | | - <goal>repackage</goal> |
155 | | - </goals> |
156 | | - <configuration> |
157 | | - <classifier>spring-boot</classifier> |
158 | | - <mainClass>com.baeldung.executable.ExecutableMavenJar</mainClass> |
159 | | - </configuration> |
160 | | - </execution> |
161 | | - </executions> |
162 | | - </plugin> |
163 | | - |
| 69 | + |
164 | 70 | <plugin> |
165 | 71 | <groupId>org.codehaus.mojo</groupId> |
166 | 72 | <artifactId>exec-maven-plugin</artifactId> |
|
250 | 156 | </build> |
251 | 157 | </profile> |
252 | 158 |
|
253 | | - <!-- java instrumentation profiles to build jars --> |
254 | | - <profile> |
255 | | - <id>buildAgentLoader</id> |
256 | | - <build> |
257 | | - <plugins> |
258 | | - <plugin> |
259 | | - <groupId>org.apache.maven.plugins</groupId> |
260 | | - <artifactId>maven-jar-plugin</artifactId> |
261 | | - <executions> |
262 | | - <execution> |
263 | | - <phase>package</phase> |
264 | | - <goals> |
265 | | - <goal>jar</goal> |
266 | | - </goals> |
267 | | - <configuration> |
268 | | - <classifier>agentLoader</classifier> |
269 | | - <classesDirectory>target/classes</classesDirectory> |
270 | | - <archive> |
271 | | - <manifest> |
272 | | - <addClasspath>true</addClasspath> |
273 | | - </manifest> |
274 | | - <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> |
275 | | - </archive> |
276 | | - |
277 | | - <includes> |
278 | | - <include>com/baeldung/instrumentation/application/AgentLoader.class</include> |
279 | | - <include>com/baeldung/instrumentation/application/Launcher.class</include> |
280 | | - </includes> |
281 | | - </configuration> |
282 | | - </execution> |
283 | | - </executions> |
284 | | - </plugin> |
285 | | - </plugins> |
286 | | - </build> |
287 | | - </profile> |
288 | | - <profile> |
289 | | - <id>buildApplication</id> |
290 | | - <build> |
291 | | - <plugins> |
292 | | - <plugin> |
293 | | - <groupId>org.apache.maven.plugins</groupId> |
294 | | - <artifactId>maven-jar-plugin</artifactId> |
295 | | - <executions> |
296 | | - <execution> |
297 | | - <phase>package</phase> |
298 | | - <goals> |
299 | | - <goal>jar</goal> |
300 | | - </goals> |
301 | | - <configuration> |
302 | | - <classifier>application</classifier> |
303 | | - <classesDirectory>target/classes</classesDirectory> |
304 | | - <archive> |
305 | | - <manifest> |
306 | | - <addClasspath>true</addClasspath> |
307 | | - </manifest> |
308 | | - <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> |
309 | | - </archive> |
310 | | - |
311 | | - <includes> |
312 | | - <include>com/baeldung/instrumentation/application/MyAtm.class</include> |
313 | | - <include>com/baeldung/instrumentation/application/MyAtmApplication.class</include> |
314 | | - <include>com/baeldung/instrumentation/application/Launcher.class</include> |
315 | | - </includes> |
316 | | - </configuration> |
317 | | - </execution> |
318 | | - </executions> |
319 | | - </plugin> |
320 | | - </plugins> |
321 | | - </build> |
322 | | - </profile> |
323 | | - <profile> |
324 | | - <id>buildAgent</id> |
325 | | - <build> |
326 | | - <plugins> |
327 | | - <plugin> |
328 | | - <groupId>org.apache.maven.plugins</groupId> |
329 | | - <artifactId>maven-jar-plugin</artifactId> |
330 | | - <executions> |
331 | | - <execution> |
332 | | - <phase>package</phase> |
333 | | - <goals> |
334 | | - <goal>jar</goal> |
335 | | - </goals> |
336 | | - <configuration> |
337 | | - <classifier>agent</classifier> |
338 | | - <classesDirectory>target/classes</classesDirectory> |
339 | | - <archive> |
340 | | - <manifest> |
341 | | - <addClasspath>true</addClasspath> |
342 | | - </manifest> |
343 | | - <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> |
344 | | - </archive> |
345 | | - |
346 | | - <includes> |
347 | | - <include>com/baeldung/instrumentation/agent/AtmTransformer.class</include> |
348 | | - <include>com/baeldung/instrumentation/agent/MyInstrumentationAgent.class</include> |
349 | | - </includes> |
350 | | - </configuration> |
351 | | - </execution> |
352 | | - </executions> |
353 | | - </plugin> |
354 | | - </plugins> |
355 | | - </build> |
356 | | - </profile> |
357 | 159 | </profiles> |
358 | 160 |
|
359 | 161 | <properties> |
|
368 | 170 |
|
369 | 171 | <!-- maven and spring plugins --> |
370 | 172 | <maven-javadoc-plugin.version>3.0.0-M1</maven-javadoc-plugin.version> |
371 | | - <maven-jar-plugin.version>3.0.2</maven-jar-plugin.version> |
372 | | - <onejar-maven-plugin.version>1.4.4</onejar-maven-plugin.version> |
373 | | - <maven-shade-plugin.version>3.1.1</maven-shade-plugin.version> |
374 | | - <spring-boot-maven-plugin.version>2.0.3.RELEASE</spring-boot-maven-plugin.version> |
375 | 173 | <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version> |
376 | 174 | <source.version>1.8</source.version> |
377 | 175 | <target.version>1.8</target.version> |
|
0 commit comments