dha*_*ram 21 tomcat intellij-idea
关于这个网站有很多问题,请放心,我已经检查了它们,但没有找到我的答案.
我真的是IntelliJ的新手.这是我的编辑配置截图.请帮我在这个IDE中添加tomcat服务器,我知道如何在Eclipse中完成它,但Intellij给了我很多时间.

你有没有想过使用maven?如果这样做,您可以使用"tomcat7-maven-plugin"及其目标"deploy"和"undeploy".
这是一个示例pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.example</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>dm-p0-servlet</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<url>http://localhost:8080/manager/text</url>
<server>tomcat7-local</server>
<path>/miniservlet</path>
</configuration>
<executions>
<execution>
<id>clean-undeploy</id>
<phase>clean</phase>
<goals>
<goal>undeploy</goal>
</goals>
</execution>
<execution>
<id>package-deploy</id>
<phase>package</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)
该元素<server>tomcat7-local</server>指的是存储Tomcat服务器身份验证凭据的<servers> 部分~/.m2/settings.xml:
<servers>
<server>
<id>tomcat7-local</id>
<username>adminScript</username>
<password>geheim</password>
</server>
</servers>
Run Code Online (Sandbox Code Playgroud)
用户名"adminScript"及其密码在中定义<Tomcat-Home>/conf/tomcat-users.xml.
| 归档时间: |
|
| 查看次数: |
57776 次 |
| 最近记录: |