1- <project xmlns =" http://maven.apache.org/POM/4.0.0"
2- xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
3- xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0
1+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
2+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0
43http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5- <modelVersion >4.0.0</modelVersion >
6- <groupId >com.cloudcontrolled.sample.mysql</groupId >
7- <artifactId >java-mysql-example-app</artifactId >
8- <version >1.0-SNAPSHOT</version >
9- <packaging >jar</packaging >
4+ <modelVersion >4.0.0</modelVersion >
5+ <groupId >com.cloudcontrolled.sample.mysql</groupId >
6+ <artifactId >java-mysql-example-app</artifactId >
7+ <version >1.0-SNAPSHOT</version >
8+ <packaging >jar</packaging >
109 <dependencies >
1110 <dependency >
1211 <groupId >mysql</groupId >
@@ -40,9 +39,11 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
4039 <execution >
4140 <id >copy-dependencies</id >
4241 <phase >package</phase >
43- <goals ><goal >copy-dependencies</goal ></goals >
42+ <goals >
43+ <goal >copy-dependencies</goal >
44+ </goals >
4445 <configuration >
45- <outputDirectory >${project.build.directory} /lib</outputDirectory >
46+ <outputDirectory >${project.build.directory} /lib</outputDirectory >
4647 </configuration >
4748 </execution >
4849 </executions >
@@ -55,22 +56,30 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
5556 <source >1.8</source >
5657 <target >1.8</target >
5758 </configuration >
58- </plugin >
59+ </plugin >
5960 <plugin >
60- <!-- Build an executable JAR -->
61- <groupId >org.apache.maven.plugins</groupId >
62- <artifactId >maven-jar-plugin</artifactId >
63- <version >3.1.0</version >
64- <configuration >
65- <archive >
66- <manifest >
67- <addClasspath >true</addClasspath >
68- <classpathPrefix >lib/</classpathPrefix >
69- <mainClass >com.cloudcontrolled.sample.mysql.App</mainClass >
70- </manifest >
71- </archive >
72- </configuration >
73- </plugin >
61+ <artifactId >maven-assembly-plugin</artifactId >
62+ <executions >
63+ <execution >
64+ <phase >package</phase >
65+ <goals >
66+ <goal >single</goal >
67+ </goals >
68+ </execution >
69+ </executions >
70+ <configuration >
71+ <archive >
72+ <manifest >
73+ <addClasspath >true</addClasspath >
74+ <classpathPrefix >lib/</classpathPrefix >
75+ <mainClass >com.cloudcontrolled.sample.mysql.App</mainClass >
76+ </manifest >
77+ </archive >
78+ <descriptorRefs >
79+ <descriptorRef >jar-with-dependencies</descriptorRef >
80+ </descriptorRefs >
81+ </configuration >
82+ </plugin >
7483 </plugins >
7584 </build >
7685</project >
0 commit comments