JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
2023-09-27 14:21:58 时间
Sts启用了地址:https://start.aliyun.com/
报这个错误,是因为没有获取到相关的版本信息,之前我用的是spring boot 2.2.1.RELEASE
改为2.5.6就可以了。
<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.5.6</version> <relativePath /> <!-- lookup parent from repository --> </parent> <groupId>com.test</groupId> <artifactId>SpringSecurityDemo1</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> </dependencies> </project>
这样就出现了Spring菜单-- Add Starters
增加依赖:
点击next,然后勾选pom.xml,点击finishi按钮,系统会自动加入依赖。
增加依赖后pom.xml变成了:
<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.5.6</version> <relativePath /> <!-- lookup parent from repository --> </parent> <groupId>com.test</groupId> <artifactId>SpringSecurityDemo1</artifactId> <version>0.0.1-SNAPSHOT</version> <dependencies> <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-security</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>org.springframework.security</groupId> <artifactId>spring-security-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-devtools</artifactId> <scope>runtime</scope> <optional>true</optional> </dependency> </dependencies> <properties> <java.version>1.8</java.version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <spring-boot.version>2.5.6</spring-boot.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.1</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.5.6</version> <configuration> <mainClass>com.test.SpringSecurityDemo1.SpringSecurityDemo1Application</mainClass> </configuration> <executions> <execution> <id>repackage</id> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </project>
也可以用向导:
这样就可以直接加入依赖了。
相关文章
- 学习Entity Framework 中的Code First
- 学习ASP.NET MVC(九)——“Code First Migrations ”工具使用示例
- How to run python interactive in current file's directory in Visual Studio Code? Python路径问题
- [tool] Visual Studio Code python配置
- 微信小程序 - 根据后端返回的唯一 ID / code,生成 “唯一“ 的推荐码、邀请码、订单号、加密路由、一串英文+数字长字符等 (支持反序列化原 ID 解码,逆向得出 ID 二者互转)wechat
- VS Code 2022路线图:大量Spring Boot优化提上日程
- Visual Studio Code 的 launch.json 解析
- keil5报错:* RESTRICTED VERSION WITH 0800H BYTE CODE SIZE LIMIT; USED: 08B5H BYTE (108%) *保姆级教程
- HTTP协议状态码详解(HTTP Status Code)(转)
- Lua 与C/C++ 交互系列:注冊枚举enum到Lua Code中
- pycharm安装包时:Non-zero exit code (1)
- linux网卡出现问题:Job for network.service failed because the control process exited with error code问题
- powerDesigner16.6 设置name不自动等于code(转载)