Skip to content

Commit af7ad07

Browse files
author
Dave Syer
committed
Fix broken jar file location for Maven
1 parent ee2fb63 commit af7ad07

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

build_an_executable_jar_with_both.adoc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22

33
You can run the application from the command line with Gradle or Maven. Or you can build a single executable JAR file that contains all the necessary dependencies, classes, and resources, and run that. This makes it easy to ship, version, and deploy the service as an application throughout the development lifecycle, across different environments, and so forth.
44

5-
If you are using Gradle, you can run the application using `./gradlew bootRun`. Or you can build the JAR file using `./gradlew build`.
5+
If you are using Gradle, you can run the application using `./gradlew bootRun`. Or you can build the JAR file using `./gradlew build`. Then you can run the JAR file:
66

7-
If you are using Maven, you can run the application using `./mvnw spring-boot:run`. Or you can build the JAR file with `./mvnw clean package`.
7+
[subs="attributes", role="has-copy-button"]
8+
....
9+
java -jar build/libs/{project_id}-0.1.0.jar
10+
....
811

9-
Then you can run the JAR file:
12+
If you are using Maven, you can run the application using `./mvnw spring-boot:run`. Or you can build the JAR file with `./mvnw clean package`. Then you can run the JAR file:
1013

1114
[subs="attributes", role="has-copy-button"]
1215
....
13-
java -jar build/libs/{project_id}-0.1.0.jar
16+
java -jar target/{project_id}-0.1.0.jar
1417
....
1518

1619
NOTE: The procedure above will create a runnable JAR. You can also opt to link:/guides/gs/convert-jar-to-war/[build a classic WAR file] instead.

0 commit comments

Comments
 (0)