Initial commit
This commit is contained in:
commit
12b1cc8854
46 changed files with 1227 additions and 0 deletions
|
@ -0,0 +1,57 @@
|
|||
package com.example.demo;
|
||||
|
||||
import rife.bld.BuildCommand;
|
||||
import rife.bld.WebProject;
|
||||
import rife.bld.extension.BootJarOperation;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
|
||||
import static rife.bld.dependencies.Scope.*;
|
||||
|
||||
public class DemoApplicationBuild extends WebProject {
|
||||
public DemoApplicationBuild() {
|
||||
pkg = "com.example.demo";
|
||||
name = "DemoApplication";
|
||||
mainClass = "com.example.demo.DemoApplication";
|
||||
version = version(0, 1, 0);
|
||||
|
||||
javaRelease = 17;
|
||||
|
||||
autoDownloadPurge = true;
|
||||
|
||||
repositories = List.of(MAVEN_CENTRAL);
|
||||
|
||||
scope(compile)
|
||||
.include(dependency("org.springframework.boot:spring-boot-starter:3.1.5"))
|
||||
.include(dependency("org.springframework.boot:spring-boot-starter-actuator:3.1.5"))
|
||||
.include(dependency("org.springframework.boot:spring-boot-starter-web:3.1.5"));
|
||||
scope(test)
|
||||
.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) {
|
||||
var level = Level.FINER;
|
||||
var consoleHandler = new ConsoleHandler();
|
||||
consoleHandler.setLevel(level);
|
||||
var logger = Logger.getLogger(BootJarOperation.class.getName());
|
||||
logger.addHandler(consoleHandler);
|
||||
logger.setLevel(level);
|
||||
|
||||
new DemoApplicationBuild().start(args);
|
||||
}
|
||||
|
||||
@BuildCommand(summary = "Creates an executable JAR for the project")
|
||||
public void jar() throws Exception {
|
||||
new BootJarOperation()
|
||||
.fromProject(this)
|
||||
.execute();
|
||||
}
|
||||
}
|
13
examples/src/main/java/com/example/demo/DemoApplication.java
Normal file
13
examples/src/main/java/com/example/demo/DemoApplication.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package com.example.demo;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
public class DemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DemoApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.example.demo;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class DemoApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
System.err.println("ah");
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue