Skip to content

Commit 6df0908

Browse files
authored
Merge pull request #241 from Dokyeongyun/ft-220511-multiModuleProject
Ft 220511 multi module project
2 parents bff2629 + 2f6693a commit 6df0908

File tree

201 files changed

+374
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+374
-111
lines changed

.classpath

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="src" output="bin/main" path="src/main/java">
4-
<attributes>
5-
<attribute name="gradle_scope" value="main"/>
6-
<attribute name="gradle_used_by_scope" value="main,test"/>
7-
</attributes>
8-
</classpathentry>
9-
<classpathentry kind="src" output="bin/main" path="src/main/resources">
10-
<attributes>
11-
<attribute name="gradle_scope" value="main"/>
12-
<attribute name="gradle_used_by_scope" value="main,test"/>
13-
</attributes>
14-
</classpathentry>
15-
<classpathentry kind="src" output="bin/test" path="src/test/java">
16-
<attributes>
17-
<attribute name="gradle_scope" value="test"/>
18-
<attribute name="gradle_used_by_scope" value="test"/>
19-
<attribute name="test" value="true"/>
20-
</attributes>
21-
</classpathentry>
223
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-9/"/>
234
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
245
<classpathentry kind="output" path="bin/default"/>

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44

55
.settings/
66

7-
.project/
7+
.project
88

9-
.classpath/
9+
.classpath
10+
11+
.metadata/*
1012

1113
/report/
1214

.project

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
33
<name>DBMonitoring</name>
4-
<comment>DBMonitoring</comment>
4+
<comment></comment>
55
<projects>
66
</projects>
77
<buildSpec>
8-
<buildCommand>
9-
<name>org.eclipse.jdt.core.javabuilder</name>
10-
<arguments>
11-
</arguments>
12-
</buildCommand>
138
<buildCommand>
149
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
1510
<arguments>
1611
</arguments>
1712
</buildCommand>
1813
</buildSpec>
1914
<natures>
20-
<nature>org.eclipse.jdt.core.javanature</nature>
2115
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
2216
</natures>
2317
</projectDescription>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/bin/
2+
/build/
3+
/logs/*
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
buildscript {
2+
repositories {
3+
mavenCentral()
4+
}
5+
dependencies {
6+
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.6.4")
7+
}
8+
}
9+
10+
plugins {
11+
id 'java'
12+
id 'org.springframework.boot' version '2.6.4'
13+
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
14+
}
15+
16+
repositories {
17+
mavenCentral()
18+
}
19+
20+
dependencies {
21+
// Spring
22+
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-thymeleaf', version: '2.6.4'
23+
implementation 'org.springframework.boot:spring-boot-starter-web'
24+
25+
// Logback
26+
implementation 'ch.qos.logback:logback-classic:1.2.3'
27+
}
28+
29+
group = 'DBMonitoringDownloaderApp'
30+
version = '0.0.1-SNAPSHOT'
31+
description = 'DBMonitoringDownloaderApp'
32+
33+
java.sourceCompatibility = JavaVersion.VERSION_15
34+
java.targetCompatibility = JavaVersion.VERSION_15
35+
36+
sourceSets.main.java.srcDirs = ['src/main/java']
37+
sourceSets.test.java.srcDirs = ['src/test/java']
38+
39+
40+
tasks.named("bootRun") {
41+
mainClass = 'root.applications.Application'
42+
}
43+
44+
tasks.named("bootJar") {
45+
mainClass = 'root.applications.Application'
46+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
spring:
2+
application:
3+
name: DBMonitoringDownloaderApp
4+
http:
5+
encoding:
6+
charset: UTF-8
7+
enabled: true
8+
force: true
9+
server:
10+
port: 8081
11+
servlet:
12+
context-path: /
13+
14+
logging:
15+
config: config/logback.xml
16+
17+
#logging:
18+
# level:
19+
# root: info
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
spring:
2+
profiles:
3+
active: prod
4+
application:
5+
name: DBMonitoringDownloaderApp
6+
http:
7+
encoding:
8+
charset: UTF-8
9+
enabled: true
10+
force: true
11+
server:
12+
port: 8081
13+
servlet:
14+
context-path: /
15+
16+
17+
logging:
18+
config: config/logback.xml
19+
20+
#logging:
21+
# level:
22+
# root: info
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration scan="true" scanperiod="30 seconds">
3+
4+
<property name="LOG_PATTERN" value="%date %level [%thread] %logger{10} [%file:%line] - %msg%n%ex{full}"/>
5+
<property name="LOG_PATTERN1" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"/>
6+
<property name="LOG_PATTERN2" value="%d{yyyy-MM-dd HH:mm:ss}[%-15thread] %-5level [%file:%line] - %msg%n%ex{full}"/>
7+
<property name="LOG_DIR" value="./logs" />
8+
<property name="LOG_FILE" value="agent" />
9+
10+
<appender name="console"
11+
class="ch.qos.logback.core.ConsoleAppender">
12+
<encoder>
13+
<pattern>${LOG_PATTERN}</pattern>
14+
</encoder>
15+
</appender>
16+
17+
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
18+
<file>${LOG_DIR}/${LOG_FILE}.log</file>
19+
<rollingPolicy
20+
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
21+
<!-- daily rollover -->
22+
<fileNamePattern>${LOG_FILE}.%d{yyyy-MM-dd}.gz</fileNamePattern>
23+
24+
<maxHistory>100</maxHistory>
25+
<totalSizeCap>500MB</totalSizeCap>
26+
</rollingPolicy>
27+
<encoder>
28+
<pattern>${LOG_PATTERN}</pattern>
29+
</encoder>
30+
</appender>
31+
32+
<logger name="root" level="info">
33+
<appender-ref ref="console" />
34+
<appender-ref ref="FILE" />
35+
</logger>
36+
37+
</configuration>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package root.applications;
2+
3+
import java.util.Arrays;
4+
5+
import org.springframework.boot.CommandLineRunner;
6+
import org.springframework.boot.SpringApplication;
7+
import org.springframework.boot.autoconfigure.SpringBootApplication;
8+
import org.springframework.context.ApplicationContext;
9+
import org.springframework.context.annotation.Bean;
10+
import org.springframework.context.annotation.ComponentScan;
11+
12+
import lombok.extern.slf4j.Slf4j;
13+
14+
@ComponentScan(basePackages = { "root.handler" })
15+
@Slf4j
16+
@SpringBootApplication
17+
public class Application {
18+
19+
public static void main(String[] args) {
20+
SpringApplication.run(Application.class, args);
21+
}
22+
23+
@Bean
24+
public CommandLineRunner commandLineRunner(ApplicationContext ctx) {
25+
return args -> {
26+
log.info("Let's inspect the beans provided by Spring Boot");
27+
28+
String[] beanNames = ctx.getBeanDefinitionNames();
29+
Arrays.sort(beanNames);
30+
for (String beanName : beanNames) {
31+
log.debug(beanName);
32+
}
33+
};
34+
}
35+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package root.configuration;
2+
3+
import javax.annotation.PostConstruct;
4+
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.context.ApplicationContext;
7+
import org.springframework.context.annotation.Configuration;
8+
import org.springframework.core.env.Environment;
9+
10+
11+
@Configuration
12+
public class AppConfiguration {
13+
14+
@Autowired
15+
private ApplicationContext context;
16+
17+
@Autowired
18+
private Environment env;
19+
20+
@PostConstruct
21+
public void init() {
22+
}
23+
}

0 commit comments

Comments
 (0)