# HG changeset patch # User Dirk Olmes # Date 1600356288 -7200 # Node ID fe6a57f7a2cf04883fa1f2ae248c324c8584a51d # Parent 8504317b9a09acead2a674a3a7d642df075a038e Spring Cloud Config server diff -r 8504317b9a09 -r fe6a57f7a2cf spring-cloud-config-server/.gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-cloud-config-server/.gitignore Thu Sep 17 17:24:48 2020 +0200 @@ -0,0 +1,4 @@ +.classpath +.project +.settings +target diff -r 8504317b9a09 -r fe6a57f7a2cf spring-cloud-config-server/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-cloud-config-server/pom.xml Thu Sep 17 17:24:48 2020 +0200 @@ -0,0 +1,115 @@ + + + 4.0.0 + de.comline + spring-cloud-config-server + 1.0-SNAPSHOT + jar + Spring Cloud Config Server + http://www.comline.de + + + 1.8 + 1.8 + UTF-8 + UTF-8 + + + + + + org.springframework.boot + spring-boot-starter-parent + 2.3.3.RELEASE + pom + import + + + org.springframework.cloud + spring-cloud-dependencies + Hoxton.SR8 + pom + import + + + + + + + org.springframework.cloud + spring-cloud-config-server + + + org.eclipse.jgit + org.eclipse.jgit + + + org.eclipse.jgit + org.eclipse.jgit.http.apache + + + + + + com.jcraft + jsch + + + org.springframework.data + spring-data-jdbc + + + com.zaxxer + HikariCP + + + com.h2database + h2 + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.platform + junit-platform-launcher + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + ${project.build.sourceEncoding} + ${maven.compiler.source} + ${maven.compiler.target} + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.0.0-M5 + + + false + + false + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff -r 8504317b9a09 -r fe6a57f7a2cf spring-cloud-config-server/src/main/java/de/comline/config/application/ConfigServer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-cloud-config-server/src/main/java/de/comline/config/application/ConfigServer.java Thu Sep 17 17:24:48 2020 +0200 @@ -0,0 +1,17 @@ +package de.comline.config.application; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.config.server.EnableConfigServer; +import org.springframework.context.annotation.Import; + +import de.comline.config.configuration.H2WebConsoleConfig; + +@SpringBootApplication +@EnableConfigServer +@Import(H2WebConsoleConfig.class) +public class ConfigServer { + public static void main(String[] args) { + SpringApplication.run(ConfigServer.class, args); + } +} diff -r 8504317b9a09 -r fe6a57f7a2cf spring-cloud-config-server/src/main/java/de/comline/config/configuration/H2WebConsoleConfig.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-cloud-config-server/src/main/java/de/comline/config/configuration/H2WebConsoleConfig.java Thu Sep 17 17:24:48 2020 +0200 @@ -0,0 +1,20 @@ +package de.comline.config.configuration; + +import org.h2.tools.Server; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class H2WebConsoleConfig { + private static final Logger LOG = LoggerFactory.getLogger(H2WebConsoleConfig.class); + + @Bean(name = "h2WebConsole", initMethod = "start", destroyMethod = "stop") + public Server buildServer() throws Exception { + String port = "8081"; + + LOG.info("H2 web console server listening on port " + port); + return Server.createWebServer("-web", "-webAllowOthers", "-webPort", port); + } +} diff -r 8504317b9a09 -r fe6a57f7a2cf spring-cloud-config-server/src/main/resources/application.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-cloud-config-server/src/main/resources/application.properties Thu Sep 17 17:24:48 2020 +0200 @@ -0,0 +1,15 @@ +#debug = true + +logging.pattern.console = %d{HH:mm:ss.SSS} %-5p [%10.10t] %c{1} : %m%n + +server.port = 8888 + +spring.application.name = spring-cloud-config-server + +spring.cloud.config.server.jdbc.bootstrap = true +spring.cloud.config.server.git.enabled = false + +spring.datasource.url = jdbc:h2:./target/db/config;AUTO_SERVER=true + +spring.main.banner-mode = off +spring.profiles.active = jdbc \ No newline at end of file diff -r 8504317b9a09 -r fe6a57f7a2cf spring-cloud-config-server/src/test/resources/log4j.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spring-cloud-config-server/src/test/resources/log4j.properties Thu Sep 17 17:24:48 2020 +0200 @@ -0,0 +1,7 @@ + +# The usual stuff. Note that A1 is configured in root, not separately +log4j.rootCategory = DEBUG, A1 +log4j.appender.A1 = org.apache.log4j.ConsoleAppender +log4j.appender.A1.layout = org.apache.log4j.PatternLayout +#log4j.appender.A1.layout.ConversionPattern = %d{MMM dd HH:mm:ss} [%t] %p %c - %m%n +log4j.appender.A1.layout.ConversionPattern = %c{1} - %m%n