-
Notifications
You must be signed in to change notification settings - Fork 0
/
ApplicationBuild.java
55 lines (44 loc) · 1.89 KB
/
ApplicationBuild.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.example.springboot;
import rife.bld.BuildCommand;
import rife.bld.WebProject;
import rife.bld.extension.BootJarOperation;
import rife.bld.extension.BootWarOperation;
import java.util.List;
import static rife.bld.dependencies.Repository.MAVEN_CENTRAL;
import static rife.bld.dependencies.Scope.*;
public class ApplicationBuild extends WebProject {
public ApplicationBuild() {
pkg = "com.example.demo";
name = "DemoApplication";
mainClass = "com.example.springboot.Application";
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.3.5"))
.include(dependency("org.springframework.boot:spring-boot-starter-actuator:3.3.5"))
.include(dependency("org.springframework.boot:spring-boot-starter-web:3.3.5"));
scope(test)
.include(dependency("org.springframework.boot:spring-boot-starter-test:3.3.5"))
.include(dependency("org.junit.jupiter:junit-jupiter:5.11.3"))
.include(dependency("org.junit.platform:junit-platform-console-standalone:1.11.3"));
scope(standalone)
.include(dependency("org.springframework.boot:spring-boot-loader:3.3.5"));
}
public static void main(String[] args) {
new ApplicationBuild().start(args);
}
@BuildCommand(summary = "Creates an executable JAR for the project")
public void bootjar() throws Exception {
new BootJarOperation()
.fromProject(this)
.execute();
}
@BuildCommand(summary = "Create an executable WAR for the project")
public void bootwar() throws Exception {
new BootWarOperation()
.fromProject(this)
.execute();
}
}