java - spring 工具套件 3.6.3 版本的多个问题

标签 java spring maven spring-mvc spring-tool-suite

我一直想学习 Spring MVC,我看了看 javavids - YouTube ,我想跟进这个系列,但我有很多问题 首先,我在 Maven 存储库中重建全局存储库

已解决

enter image description here

然后我创建了 Maven 项目,但视频中的结构是

enter image description here

但我有这个

已解决

enter image description here

好的,现在我想将插件添加到 pom.xml 但得到这个对话框 在视频中显示:

更新
enter image description here
我没有从
中选择任何插件 enter image description here
已解决
我也有编译器合规性 enter image description here 当我将编译器设置为 java 1.7 时,我得到了
已解决
enter image description here

最后,当我尝试更新 STS 3.6.3 时,它卡住并显示 enter image description here
确定
我的代理设置为

enter image description here

更新 我根据这个 Answer 进行更改并添加依赖项
我收到此错误:
enter image description here
现在我看不到可以帮助我解决这些遗留问题的资源! 非常感谢任何帮助。

最佳答案

首先maven默认编译级别设置为1.5。 为了将它设置为 1.7 或者配置 ma​​ven-compiler-plugin

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

或添加以下属性。

<properties>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
</properties>

设置java版本后按Alt+F5更新maven项目。

为了搜索依赖项或插件,请转到Window -> Preferences -> Maven 并选中 Download repository index update on startup

重启STS,等待索引更新完成。

关于您的项目结构检查确实有 <packaging>war</packaging>在你的 pom.xml 中。默认情况下它将是 jar类型。

关于java - spring 工具套件 3.6.3 版本的多个问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30565062/

相关文章:

java - 当使用外观 session bean 时,为什么我们还应该使用业务 session bean?

使用 org.xml.sax.XMLReader 进行 Java XML 替换

java - 创建 Maven Web 项目时出现重复的源文件夹

eclipse - 在 Eclipse 中调试 Tomcat Web 应用程序

java - 如何从 JAX RS 注释接口(interface)生成 swagger 规范?

java - 使用微调器过滤 map 标记

java - play 创建字段按字母顺序排序的表

java - 如何在 Quartz Scheduler(简单触发器)中包含 endTime 属性?

java - 具有 0 个或多个任意类型参数的 Spring AOP 切入点表达式方法会抛出 java.lang.NullPointerException

java - 访问 token 的 Outlook API 在 Java Spring 中返回 400 错误请求