简体   繁体   English

Tomcat-Eclipse中的服务器

[英]Tomcat - Server in Eclipse

I have a really basic Spring app which I deploy using mavens tomcat:run command and it works fine. 我有一个非常基本的Spring应用程序,可以使用mavens tomcat:run命令进行部署,并且运行良好。 However, I want it to start and deploy to the server which is located in Eclipse 'server' tab. 但是,我希望它启动并部署到位于Eclipse“服务器”选项卡中的服务器。 At the moment it looks like it's deploying to a different one? 目前看来,它正在部署到另一个?

I have got WTP plugin installed. 我已经安装了WTP插件。

Also, here are my dependencies and plugins: 另外,这是我的依赖项和插件:

    <dependencies>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>6.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>4.2.2.RELEASE</version>
    </dependency>
</dependencies>

<build>
    <!--BEGIN - Plugins -->
    <plugins>
        <plugin>
            <groupId>org.apache.tomcat.maven</groupId>
            <artifactId>tomcat9-maven-plugin</artifactId>
            <version>9</version>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.7.0</version>
            <configuration>
                <path>/</path>
                    <contextReloadable>true</contextReloadable>
            </configuration>
        </plugin>
    </plugins>
    <!--END - Plugins -->
</build>

You need to first add the server from server tab and then configure the project on the server. 您需要首先从服务器选项卡添加服务器,然后在服务器上配置项目。 Then you simply just right click on the project and select run on server, then your project will run on the server that is defined in the servers tab in eclipse. 然后,您只需右键单击项目并选择“在服务器上运行”,然后您的项目将在eclipse的“服务器”选项卡中定义的服务器上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM