java spring项目没有读取所有依赖项

标签 java spring intellij-idea

我与 Intellij 合作开发了一个 java spring 项目

当我构建并运行项目时,出现这些错误:

cannot resolve symbol 'springframework'

Error:(32, 48) java: diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)

Error:(33, 55) java: method references are not supported in -source 1.5 (use -source 8 or higher to enable method references)

我搜索过类似的问题,但没有与我合作

我已经尝试过:

使缓存无效并重新导入到 Maven 依赖项,但仍然给出错误

我的java版本:javac 1.8.0_111

enter image description here

maven错误:

enter image description here

并将错误日志文件上传到drive

最佳答案

可能是 Maven 的问题。在 pom.xml 中更新或添加 maven-compiler-plugin 插件。

<build>
    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>//version_number</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

    </plugins>
</build

关于java spring项目没有读取所有依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57637104/

相关文章:

git - IntelliJ (Git) - 清除存储并恢复它

java - 在非 Maven-Non-Spring 项目中包含 Maven-Spring-Roo-Hibernate jar 的正确步骤是什么?

java - 如何创建Makefile来分别编译aC文件和Java文件

java - 单作者多读者原语图

intellij-idea - Intellij 中的链式方法和连续缩进

Android IntelliJ IDEA 项目和 TeamCity(检查)

java - 未注入(inject) Spring TaskScheduler Bean

java - Spring AOP 通用类型

java - 在localhost启动tomcat v9.0服务器遇到问题

java - 将 Spring Boot 应用程序(使用 javax.persistence)升级到 JDK 11