我有一个工作的eclipse项目,它与tomcat Server一起使用,它被添加到eclipse中,但是当我现在尝试在另一台PC上使用它时,它找不到资源。
我使用pom.xml转到项目目录,并通过命令...
[INFO] --- tomcat7-maven-plugin:2.2:run (default-cli) @ Cloud-Datenmanagement ---
[INFO] Running war on http://localhost:8080/Cloud-Datenmanagement
[INFO] Creating Tomcat server configuration at E:\Onedrive\Projekte\SYT_5BHIT\GK9.3\Cloud-Datenmanagement\target\tomcat
[INFO] create webapp with contextPath: /Cloud-Datenmanagement
Nov. 06, 2017 9:29:21 VORM. org.apache.coyote.AbstractProtocol init
INFORMATION: Initializing ProtocolHandler ["http-bio-8080"]
Nov. 06, 2017 9:29:21 VORM. org.apache.catalina.core.StandardService startInternal
INFORMATION: Starting service Tomcat
Nov. 06, 2017 9:29:21 VORM. org.apache.catalina.core.StandardEngine startInternal
INFORMATION: Starting Servlet Engine: Apache Tomcat/7.0.47
Nov. 06, 2017 9:29:23 VORM. org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFORMATION: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [174] milliseconds.
Nov. 06, 2017 9:29:23 VORM. org.apache.coyote.AbstractProtocol start
INFORMATION: Starting ProtocolHandler ["http-bio-8080"]
尝试运行它。我得到以下输出。
The requested resource is not available.
当我现在尝试访问该网站时,收到包含说明<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>Cloud-Datenmanagement</groupId>
<artifactId>Cloud-Datenmanagement</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<webResources>
<resource>
<directory>WebContent</directory>
</resource>
</webResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20170516</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.195</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<type>maven-plugin</type>
<scope>provided</scope>
</dependency>
<!-- Testing -->
<dependency>
<groupId>org.glassfish.jersey.test-framework.providers</groupId>
<artifactId>jersey-test-framework-provider-jetty</artifactId>
<version>2.26</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
我认为,maven不包括war文件中的类,但我不确定,我不知道如何解决它。
下面是我的pom.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="" docBase="Cloud-Datenmanagement">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
</Context>
context.xml中
AdLoader