diff --git a/.idea/misc.xml b/.idea/misc.xml index a997f4b..b5b996d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,3 +1,4 @@ + @@ -18,6 +19,15 @@ + diff --git a/.vscode/launch.json b/.vscode/launch.json index cc60f4a..f324478 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,11 +1,24 @@ { "version": "0.2.0", "configurations": [ + { + "type": "java", + "name": "Run Main", + "request": "launch", + "mainClass": "com.example.springboot.Application" + }, { "type": "java", "name": "Run Tests", "request": "launch", - "mainClass": "com.example.springboot.DemoApplicationTests" + "mainClass": "org.junit.platform.console.ConsoleLauncher", + "args": [ + "--details=verbose", + "--scan-classpath", + "--disable-banner", + "--disable-ansi-colors", + "--exclude-engine=junit-platform-suite", + "--exclude-engine=junit-vintage"] } ] } diff --git a/README.md b/README.md index c531b7d..4fc7a51 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Spring Boot Example for [bld](https://rife2.com/bld) -Based on the Spring Guides' Spring Boot web application example. Please be sure to read the [guide](https://github.com/spring-guides/gs-spring-boot) for a sampling of how Spring Boot can help you accelerate application development +Based on the Spring Guides' Spring Boot web application example. Please be sure to read the +[guide](https://spring.io/guides/gs/spring-boot/) for a sampling of how Spring Boot can help +you accelerate application development ## Run the Application @@ -31,3 +33,10 @@ To run the web application tests, issue the following command: ``` ./bld test ``` + +## To create and launching the executable JAR + +``` +./bld jar +java -jar build/dist/demoapplication-0.1.0.jar +``` diff --git a/lib/bld/bld-wrapper.properties b/lib/bld/bld-wrapper.properties index 65caa7a..075e951 100644 --- a/lib/bld/bld-wrapper.properties +++ b/lib/bld/bld-wrapper.properties @@ -1,7 +1,7 @@ bld.downloadExtensionJavadoc=false bld.downloadExtensionSources=true -bld.extensions= -bld.repositories=MAVEN_CENTRAL,RIFE2_RELEASES +bld.extensions=com.uwyn.rife2:bld-spring-boot:0.9.0-SNAPSHOT +bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES bld.downloadLocation= bld.sourceDirectories= bld.version=1.7.5 diff --git a/src/bld/java/com/example/springboot/ApplicationBuild.java b/src/bld/java/com/example/springboot/ApplicationBuild.java index 30ea702..4c71312 100644 --- a/src/bld/java/com/example/springboot/ApplicationBuild.java +++ b/src/bld/java/com/example/springboot/ApplicationBuild.java @@ -1,12 +1,13 @@ package com.example.springboot; +import rife.bld.BuildCommand; import rife.bld.WebProject; +import rife.bld.extension.BootJarOperation; import java.util.List; import static rife.bld.dependencies.Repository.MAVEN_CENTRAL; -import static rife.bld.dependencies.Scope.compile; -import static rife.bld.dependencies.Scope.test; +import static rife.bld.dependencies.Scope.*; public class ApplicationBuild extends WebProject { public ApplicationBuild() { @@ -29,9 +30,18 @@ public class ApplicationBuild extends WebProject { .include(dependency("org.springframework.boot:spring-boot-starter-test:3.1.5")) .include(dependency("org.junit.jupiter:junit-jupiter:5.10.0")) .include(dependency("org.junit.platform:junit-platform-console-standalone:1.10.0")); + scope(standalone) + .include(dependency("org.springframework.boot:spring-boot-loader:3.1.5")); } public static void main(String[] args) { new ApplicationBuild().start(args); } + + @BuildCommand(summary = "Creates an executable JAR for the project") + public void jar() throws Exception { + new BootJarOperation() + .fromProject(this) + .execute(); + } } \ No newline at end of file