The construction of the Springboot project generally has the following dependencies:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
<relativePath/> <!--lookup parent from repository to
</parent>
If you delete this dependency, it will appear as a problem:
Workaround, introduce maven dependencies:
<dependencyManagement>
<dependencies>
<dependency>
<!--Import Dependency Management from Spring Boot--
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.6.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
J tested, packaged words, can not run, can not use Java-jar Demo.jar run, will error no master list.
You must add the following plugins
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.transferservice.TransferServiceApplication</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
After testing, packaging, using the command Java-jar Demo.jar project can start normally.
Springboot project does not apply to parent dependency, resulting in an invalid MAVEN dependency