刚刚从Eclipse转换为Intellij,并不完全确定我在这里做错了什么:
当我在IDE中创建的Tomcat实例上本地部署war文件时,我可以点击所有服务/端点。一旦从目标文件夹中获取生成的WAR并将其放在远程服务器上的webapps文件夹中,它就会停止工作。我已经向这个服务器导出了几个eclipse WAR,我仍然可以访问所有这些应用程序。在构建工件时是否有一些我缺少的配置?
不确定它会有多大帮助,但是: 的web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- This web.xml file is not required when using Servlet 3.0 container,
see implementation details
http://jersey.java.net/nonav/documentation/latest/jax-rs.html -->
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>Jersey Web Application</servlet-name>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-
class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.valassis.rest</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey Web Application</servlet-name>
<url-pattern>/DalimRestService/*</url-pattern>
</servlet-mapping>
</web-app>
的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>com.valassis.common</groupId>
<artifactId>DalimRestService</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>DalimRestService Webapp</name>
<url>http://maven.apache.org</url>
<build>
<finalName>DalimRestService</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey</groupId>
<artifactId>jersey-bom</artifactId>
<version>${jersey.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>com.sun.jersey</groupId>-->
<!--<artifactId>jersey-bundle</artifactId>-->
<!--<version>1.19.4</version>-->
<!--</dependency>-->
</dependencies>
<properties>
<jersey.version>2.23.2</jersey.version>
</properties>
</project>