虽然我已经看到很多针对这个问题的解决方案(或者我应该称之为解决方法),但是这些文件必须被推送到外部库。偶然的项目似乎是随机的,需要将罐子导出并执行一些其他步骤才能将项目部署到外部服务器。我在下面包含了我的pom.xml文件。也许是我如何设置我的pom文件。
TIA
<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.websystique.springmvc</groupId>
<artifactId>SecureRESTApiWithBasicAuthentication</artifactId>
<version>1.0.0</version>
<packaging>war</packaging>
<name>SecureRESTApiWithBasicAuthentication</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springframework.version>4.3.1.RELEASE</springframework.version>
<springsecurity.version>4.1.1.RELEASE</springsecurity.version>
<jackson.library>2.7.5</jackson.library>
</properties>
<dependencies>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${springframework.version}</version>
</dependency>
<!-- Spring Security -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${springsecurity.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${springsecurity.version}</version>
</dependency>
<!-- Jackson libraries -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.library}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson.library}</version>
</dependency>
<!-- Servlet -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<!-- apache commons codedc -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>SecureRESTApiWithBasicAuthentication</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<finalName>SecureRESTApiWithBasicAuthentication</finalName>
</build>
</project>
以下是我收到的警告。
Description Resource Path Location Type
Classpath entry M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.7.0/jackson-annotations-2.7.0.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/com/fasterxml/jackson/core/jackson-core/2.7.5/jackson-core-2.7.5.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/com/fasterxml/jackson/core/jackson-databind/2.7.5/jackson-databind-2.7.5.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/com/fasterxml/jackson/dataformat/jackson-dataformat-xml/2.7.5/jackson-dataformat-xml-2.7.5.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/com/fasterxml/jackson/module/jackson-module-jaxb-annotations/2.7.5/jackson-module-jaxb-annotations-2.7.5.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/commons-codec/commons-codec/1.10/commons-codec-1.10.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/commons-logging/commons-logging/1.2/commons-logging-1.2.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/security/spring-security-config/4.1.1.RELEASE/spring-security-config-4.1.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/security/spring-security-core/4.1.1.RELEASE/spring-security-core-4.1.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/security/spring-security-web/4.1.1.RELEASE/spring-security-web-4.1.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/spring-aop/4.3.1.RELEASE/spring-aop-4.3.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/spring-beans/4.3.1.RELEASE/spring-beans-4.3.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/spring-context/4.3.1.RELEASE/spring-context-4.3.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/spring-core/4.3.1.RELEASE/spring-core-4.3.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/spring-expression/4.3.1.RELEASE/spring-expression-4.3.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/spring-web/4.3.1.RELEASE/spring-web-4.3.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
Classpath entry M2_REPO/org/springframework/spring-webmvc/4.3.1.RELEASE/spring-webmvc-4.3.1.RELEASE.jar will not be exported or published. Runtime ClassNotFoundExceptions may result. SecureRESTApiWithBasicAuthentication P/SecureRESTApiWithBasicAuthentication Classpath Dependency Validator Message
答案 0 :(得分:0)
似乎导致这最终是一个Eclipse问题。或多或少破坏的Eclipse项目首选项和/或与当前Eclipse项目不完全兼容的Eclipse旧项目。为了解决这个问题,我最终创建了另一个具有相同配置的项目(在本例中为Spring MVC),在项目结束时只使用下划线。然后我开始简单地复制POM文件和所有其他文件。一旦我完成,一切都很好。