springboot專案第一次啟動報錯
阿新 • • 發佈:2019-02-20
最近,看了一下spring-boot,做了一個demo的工程,啟動時居然報錯,報錯資訊:Unregistering JMX-exposed beans on shutdown。
原來是新版本的spring-boot工程在建立的時,改變了依賴的jar包:
原來的依賴
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency>
現在的依賴
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency>
在專案的pom檔案中,新增spring-boot-starter-web依賴包即可