JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON
Sts启用了地址:https://start.aliyun.com/
报这个错误,是因为没有获取到相关的版本信息,之前我用的是spring boot 2.2.1.RELEASE
改为2.5.6就可以了。
"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"> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.5.6 com.test SpringSecurityDemo1 0.0.1-SNAPSHOT org.springframework.boot spring-boot-starter-test test
这样就出现了Spring菜单-- Add Starters
增加依赖:
点击next,然后勾选pom.xml,点击finishi按钮,系统会自动加入依赖。
增加依赖后pom.xml变成了:
"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"> 4.0.0 org.springframework.boot spring-boot-starter-parent 2.5.6 com.test SpringSecurityDemo1 0.0.1-SNAPSHOT org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-starter-security org.springframework.boot spring-boot-starter-web mysql mysql-connector-java runtime org.springframework.security spring-security-test test org.springframework.boot spring-boot-starter org.springframework.boot spring-boot-devtools runtime true 1.8 UTF-8 UTF-8 2.5.6 org.springframework.boot spring-boot-dependencies ${spring-boot.version} pom import org.apache.maven.plugins maven-compiler-plugin 3.8.1 1.8 1.8 UTF-8 org.springframework.boot spring-boot-maven-plugin 2.5.6 com.test.SpringSecurityDemo1.SpringSecurityDemo1Application repackage repackage
也可以用向导:
这样就可以直接加入依赖了。