【问题标题】:multiple issues with spring tool suite 3.6.3 releasespring 工具套件 3.6.3 版本存在多个问题
【发布时间】:2015-08-14 09:57:04
【问题描述】:

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

已解决

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

但我有这个代替

已解决

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

更新

我没有任何插件可供选择

已解决
我也有编译器合规性 当我将编译器设置为 java 1.7 时,我得到
Solved

最后,当我尝试更新 STS 3.6.3 时,它冻结并显示
好的
我的代理设置为



更新 我根据这个Answer进行更改并添加依赖项
我收到此错误:

现在我没有看到可以帮助我解决这些剩余问题的资源! 非常感谢任何帮助。

【问题讨论】:

  • 你能发布你的 pom 文件吗?

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


【解决方案1】:

我认为我在这里提供的解决方案肯定会为您工作。 如果您已成功下载 Spring STS,则只需执行以下步骤即可。

创建项目后右键单击项目并更新 Maven 项目

将它与 Google App Engine 集成非常简单。您只需在 pom.xml 中声明 google 应用程序引擎依赖项。我正在向您提供我的 Google App 引擎 Spring 项目的结构。

请按照以下步骤操作 1.在WEB-INF文件夹下创建appengine-wex.xml 2.在WEB-INF文件夹下创建logging.properties文件 3. 插入谷歌应用引擎依赖

这里是示例 appengine-web.xml

    <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xml>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>make-me</application>
  <version>2</version>

  <!--
    Allows App Engine to send multiple requests to one instance in parallel:
  -->
  <threadsafe>true</threadsafe>

  <!-- Configure java.util.logging -->
  <system-properties>
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
  </system-properties>

  <!--
    HTTP Sessions are disabled by default. To enable HTTP sessions specify:

      <sessions-enabled>true</sessions-enabled>

    It's possible to reduce request latency by configuring your application to
    asynchronously write HTTP session data to the datastore:

      <async-session-persistence enabled="true" />

    With this feature enabled, there is a very small chance your app will see
    stale session data. For details, see
    http://code.google.com/appengine/docs/java/config/appconfig.html#Enabling_Sessions
  -->

</appengine-web-app>

Pom 依赖

<dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-1.0-sdk</artifactId>
            <version>1.9.1</version>
        </dependency>

        <!-- JUnit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-testing</artifactId>
            <version>1.9.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.appengine</groupId>
            <artifactId>appengine-api-stubs</artifactId>
            <version>1.9.1</version>
            <scope>test</scope>
        </dependency>

最终结构

【讨论】:

  • 好的!以这种方式,我设法创建了 Spring 项目,但我在添加 google App Engine 扩展和Apache tiles 3 时遇到了问题,我也想解决这些问题
【解决方案2】:

我还想通过使用 Spring Boot 和 http://spring.io/guides 上的指南来推荐使用 Spring Tool Suite 开始使用 Spring。您可以将这些指南直接导入 STS 并从那里开始(假设您有网络连接)。

【讨论】:

    【解决方案3】:

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

    您可以在 ide (eclipse) 中切换视角。在视频中是 Java EE-Perspective。

    你得到的是 Spring-Perspective,不用担心。

    窗口 -> 打开透视图

    好的,现在我想将插件添加到 pom.xml 但得到这个对话框

    好的,那有什么问题?

    如果您在 MVN Repository 上搜索依赖项,您将获得所有信息来填写您在对话框中看到的信息。否则你可以打开pom-文件,直接粘贴依赖。

    我也有编译器合规性

    假设您在 Eclipse 中使用 m2e 插件,您需要为 maven-compiler-plugin 指定源和目标版本为 1.7。

    用这个来指定它:

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

    并更新您的项目右键单击项目 -> maven -> 更新项目(Alt F5)

    网络似乎没问题。您使用的是私有网络还是办公网络?

    【讨论】:

    • 如果我必须单独安装 maven 或者 Spring Tool Suite 附带/附带哪个可以?
    • 我想在 pom.xml 中添加 plug-in 但选择 plu-in don't show any to add?
    • 请遵循本指南:maven.apache.org/guides/getting-started/… 添加我在帖子中建议的依赖项
    【解决方案4】:

    第一个 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 并检查启动时下载存储库索引更新

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

    关于你的项目结构检查确实在你的 pom.xml 中有&lt;packaging&gt;war&lt;/packaging&gt;。默认为jar 类型。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-10-06
      • 1970-01-01
      • 2020-03-13
      • 2016-06-25
      • 1970-01-01
      • 2014-09-27
      • 2022-01-05
      • 1970-01-01
      相关资源
      最近更新 更多