Я публикую эту похожую проблему, так как все, что я мог найти, это версия Spring 1.x.
:: Spring Boot :: (v2.2.4.RELEASE) jdk8
У меня была Spring Загрузочный веб работает. Я попытался экстернализовать свой файл свойств, который я не смог заставить работать. Последняя попытка переместить мои файлы src / main / resources / applicationaiton.yml во временный каталог.
Когда я отменил свои попытки, spring-boot-web не запустился. Все, что я получаю, - это баннерная пружина, которую я отключил в своем приложении .yml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>myGrp</groupId>
<artifactId>myApp</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>myApp</name>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<!-- Rest Endpoints -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Database -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<!-- exclude tomcat jdbc connection pool, use HikariCP -->
<exclusions>
<exclusion>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>8.2.0.jre8</version>
</dependency>
<!-- exclude tomcat-jdbc, Spring Boot will use HikariCP automatically
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>2.6.0</version>
</dependency>
-->
<!-- Encryption -->
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.1.2</version>
</dependency>
<!-- send email -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<forkCount>3</forkCount>
<reuseForks>true</reuseForks>
<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
</configuration>
</plugin>
<!--
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<forkCount>4</forkCount>
<reuseForks>true</reuseForks>
<useSystemClassLoader>true</useSystemClassLoader>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
-->
</plugins>
</build>
</project>
@SpringBootApplication
@EnableEncryptableProperties
public class MyApplication{
private static final Logger log = LoggerFactory.getLogger(MyApplication.class);
public static void main(String[] args) {
System.out.println("############# MAIN ###########");
SpringApplication.run(MyApplication.class, args);
System.out.println("############# after run ###########");
$ mvn -X spring-boot:run -Dspring.profiles.active=dev
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T10:29:23-07:00)
Maven home: C:\apps\apache-maven-3.2.5
Java version: 1.8.0_221, vendor: Oracle Corporation
Java home: C:\apps\Java\jdk1.8.0_221\jre
...
[INFO] Attaching agents: []
############# MAIN ###########
############# MAIN ###########
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.4.RELEASE)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.699 s
[INFO] Finished at: 2020-02-10T07:37:42-07:00
[INFO] Final Memory: 32M/445M
[INFO] ------------------------------------------------------------------------
$
$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TVU 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ TVU ---
[INFO] gov.dhs.tsa:TVU:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter:jar:2.2.4.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot:jar:2.2.4.RELEASE:compile
[INFO] | | \- org.springframework:spring-context:jar:5.2.3.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.2.4.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-logging:jar:2.2.4.RELEASE:compile
[INFO] | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.12.1:compile
[INFO] | | | \- org.apache.logging.log4j:log4j-api:jar:2.12.1:compile
[INFO] | | \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
[INFO] | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | +- org.springframework:spring-core:jar:5.2.3.RELEASE:compile
[INFO] | | \- org.springframework:spring-jcl:jar:5.2.3.RELEASE:compile
[INFO] | \- org.yaml:snakeyaml:jar:1.25:runtime
[INFO] +- org.springframework.boot:spring-boot-devtools:jar:2.2.4.RELEASE:runtime (optional)
[INFO] +- org.springframework.boot:spring-boot-actuator:jar:2.2.4.RELEASE:compile
[INFO] | \- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.10.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.10.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.10.2:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-databind:jar:2.10.2:compile
[INFO] +- org.springframework.boot:spring-boot-starter-web:jar:2.2.4.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.2.4.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.10.2:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.10.2:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-tomcat:jar:2.2.4.RELEASE:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-core:jar:9.0.30:compile
[INFO] | | +- org.apache.tomcat.embed:tomcat-embed-el:jar:9.0.30:compile
[INFO] | | \- org.apache.tomcat.embed:tomcat-embed-websocket:jar:9.0.30:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-validation:jar:2.2.4.RELEASE:compile
[INFO] | | +- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] | | \- org.hibernate.validator:hibernate-validator:jar:6.0.18.Final:compile
[INFO] | | +- org.jboss.logging:jboss-logging:jar:3.4.1.Final:compile
[INFO] | | \- com.fasterxml:classmate:jar:1.5.1:compile
[INFO] | +- org.springframework:spring-web:jar:5.2.3.RELEASE:compile
[INFO] | | \- org.springframework:spring-beans:jar:5.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-webmvc:jar:5.2.3.RELEASE:compile
[INFO] | +- org.springframework:spring-aop:jar:5.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-expression:jar:5.2.3.RELEASE:compile
[INFO] +- org.springframework.boot:spring-boot-starter-jdbc:jar:2.2.4.RELEASE:compile
[INFO] | +- com.zaxxer:HikariCP:jar:3.4.2:compile
[INFO] | | \- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] | \- org.springframework:spring-jdbc:jar:5.2.3.RELEASE:compile
[INFO] | \- org.springframework:spring-tx:jar:5.2.3.RELEASE:compile
[INFO] +- com.microsoft.sqlserver:mssql-jdbc:jar:8.2.0.jre8:compile
[INFO] +- com.github.ulisesbocchio:jasypt-spring-boot-starter:jar:2.1.2:compile
[INFO] | \- com.github.ulisesbocchio:jasypt-spring-boot:jar:2.1.2:compile
[INFO] | \- org.jasypt:jasypt:jar:1.9.3:compile
[INFO] +- org.springframework.boot:spring-boot-starter-mail:jar:2.2.4.RELEASE:compile
[INFO] | +- org.springframework:spring-context-support:jar:5.2.3.RELEASE:compile
[INFO] | \- com.sun.mail:jakarta.mail:jar:1.6.4:compile
[INFO] | \- com.sun.activation:jakarta.activation:jar:1.2.1:compile
[INFO] \- org.springframework.boot:spring-boot-starter-test:jar:2.2.4.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-test:jar:2.2.4.RELEASE:test
[INFO] +- org.springframework.boot:spring-boot-test-autoconfigure:jar:2.2.4.RELEASE:test
[INFO] +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] | \- net.minidev:json-smart:jar:2.3:test
[INFO] | \- net.minidev:accessors-smart:jar:1.2:test
[INFO] | \- org.ow2.asm:asm:jar:5.0.4:test
[INFO] +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:test
[INFO] | \- jakarta.activation:jakarta.activation-api:jar:1.2.1:test
[INFO] +- org.junit.jupiter:junit-jupiter:jar:5.5.2:test
[INFO] | +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:test
[INFO] | | +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] | | +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] | | \- org.junit.platform:junit-platform-commons:jar:1.5.2:test
[INFO] | +- org.junit.jupiter:junit-jupiter-params:jar:5.5.2:test
[INFO] | \- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:test
[INFO] | \- org.junit.platform:junit-platform-engine:jar:1.5.2:test
[INFO] +- org.mockito:mockito-junit-jupiter:jar:3.1.0:test
[INFO] +- org.assertj:assertj-core:jar:3.13.2:test
[INFO] +- org.hamcrest:hamcrest:jar:2.1:test
[INFO] +- org.mockito:mockito-core:jar:3.1.0:test
[INFO] | +- net.bytebuddy:byte-buddy:jar:1.10.6:test
[INFO] | +- net.bytebuddy:byte-buddy-agent:jar:1.10.6:test
[INFO] | \- org.objenesis:objenesis:jar:2.6:test
[INFO] +- org.skyscreamer:jsonassert:jar:1.5.0:test
[INFO] | \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] +- org.springframework:spring-test:jar:5.2.3.RELEASE:test
[INFO] \- org.xmlunit:xmlunit-core:jar:2.6.3:test