当前位置: 首页 > 知识库问答 >
问题:

无法在Spring工具套件中将项目添加到tomcat服务器

楚俊迈
2023-03-14

我使用的是Spring工具套件4版本:4.4.2.RELEASE

我用下面的POM创建了一个新的maven项目:

<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 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.xi</groupId>
  <artifactId>FitnessTracker</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>FitnessTracker Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.2.0.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
        <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>FitnessTracker</finalName>
  </build>
</project>

在Spring工具套件中,它看起来像这样:

然后我尝试添加一个tomcat服务器(我已经下载了tomecat 9,路径上没有问题)。

但是在上面的窗口中,我的项目没有显示在左侧的可用资源中。我可以创建这个tomcat 9服务器,我可以启动它,但我不能在服务器下添加我的项目。为什么?

共有1个答案

富凯旋
2023-03-14

检查它是jar文件还是war文件。如果jar文件服务器无法获取。如果没有,那么左键单击项目-

 类似资料:
  • 我无法将我的项目添加到Eclipse中的服务器-为什么? 我安装了所有必要的工具(Web Dev、Java EE、服务器适配器和Tomcat本身,一切) 我配置了运行时环境,将所有Java版本调整为JDK 6(因为它应该在Tomcat 6上运行),但是在创建新服务器时,我可以添加资源的对话框的左侧仍然是空的。 我还能试什么? PS:我在Windows上使用的是Eclipse v4.2 (Juno)

  • 环境 : Windows Eclipse Luna Service Release 2 (4.4.2) Tomcat 8 JDK 8 当我尝试使用

  • 在我的activity_main.xml我有这个工具栏: 在清单中有

  • 问题内容: 尝试从此处使用unstruction将alamofire添加到快速项目 完成所有这些步骤,清理项目很多计时器并重新启动XCode,没有任何帮助。错误不会消失 http://i.stack.imgur.com/kNU3R.png “无法为’Alamofire’加载基础模块”,无关紧要 我所做的更改: 1)将项目文件添加到我的项目 i.stack.imgur.com/eUe8E.png 2

  • 在vmware vfabric tc server developer edition仍在运行时关闭了STS,现在无法从STS停止服务器。有什么建议吗?

  • 我已经在spring工具套件中创建了一个spring项目。 我的代码是 正如您在这一行中看到的,我已经导入了GetMapping。 pom.xml