gpt4 book ai didi

java - 构建 war 文件时出现编译错误

转载 作者:行者123 更新时间:2023-12-01 17:55:52 25 4
gpt4 key购买 nike

当我手动运行 mvn clean install 命令时收到此错误;

[INFO] /home/bean/opt/src/main/java/com/trident/dao/daoImpl/SsoDaoImpl.java: Recompile with -Xlint:unchecked for details.
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[9,23] package org.apache.http does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[10,23] package org.apache.http does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[11,30] package org.apache.http.client does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[12,30] package org.apache.http.client does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[13,38] package org.apache.http.client.methods does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[14,38] package org.apache.http.client.methods does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[15,30] package org.apache.http.entity does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[16,35] package org.apache.http.impl.client does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[17,31] package org.apache.http.message does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[18,32] package org.apache.http.protocol does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[19,28] package org.apache.http.util does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[136,53] cannot find symbol
symbol: class HttpResponse
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[33,17] cannot find symbol
symbol: class HttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[33,45] cannot find symbol
symbol: class DefaultHttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[34,17] cannot find symbol
symbol: class HttpGet
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[34,39] cannot find symbol
symbol: class HttpGet
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[38,25] cannot find symbol
symbol: class HttpResponse
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[41,26] cannot find symbol
symbol: class ClientProtocolException
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[58,17] cannot find symbol
symbol: class HttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[58,45] cannot find symbol
symbol: class DefaultHttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[59,17] cannot find symbol
symbol: class HttpPost
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[59,41] cannot find symbol
symbol: class HttpPost
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[63,25] cannot find symbol
symbol: class HttpResponse
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[65,26] cannot find symbol
symbol: class ClientProtocolException
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[79,17] cannot find symbol
symbol: class HttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[79,45] cannot find symbol
symbol: class DefaultHttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[81,17] cannot find symbol
symbol: class HttpPost
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[81,41] cannot find symbol
symbol: class HttpPost
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[85,25] cannot find symbol
symbol: class StringEntity
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[85,57] cannot find symbol
symbol: class StringEntity
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[86,57] cannot find symbol
symbol: class BasicHeader
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[86,69] cannot find symbol
symbol: variable HTTP
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[89,25] cannot find symbol
symbol: class HttpResponse
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[93,26] cannot find symbol
symbol: class ClientProtocolException
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[109,17] cannot find symbol
symbol: class HttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[109,45] cannot find symbol
symbol: class DefaultHttpClient
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[111,17] cannot find symbol
symbol: class HttpPost
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[111,41] cannot find symbol
symbol: class HttpPost
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[115,25] cannot find symbol
symbol: class StringEntity
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[115,57] cannot find symbol
symbol: class StringEntity
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[116,57] cannot find symbol
symbol: class BasicHeader
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[116,69] cannot find symbol
symbol: variable HTTP
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[119,25] cannot find symbol
symbol: class HttpResponse
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[124,26] cannot find symbol
symbol: class ClientProtocolException
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[140,25] cannot find symbol
symbol: class HttpEntity
location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[157,25] cannot find symbol
symbol: variable EntityUtils
location: class com.trident.service.Salesforce.HttpService
[INFO] 46 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.589 s
[INFO] Finished at: 2017-06-29T00:35:37-07:00
[INFO] Final Memory: 20M/63M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project opt: Compilation failure: Compilation failure:
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[9,23] package org.apache.http does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[10,23] package org.apache.http does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[11,30] package org.apache.http.client does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[12,30] package org.apache.http.client does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[13,38] package org.apache.http.client.methods does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[14,38] package org.apache.http.client.methods does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[15,30] package org.apache.http.entity does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[16,35] package org.apache.http.impl.client does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[17,31] package org.apache.http.message does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[18,32] package org.apache.http.protocol does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[19,28] package org.apache.http.util does not exist
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[136,53] cannot find symbol
[ERROR] symbol: class HttpResponse
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[33,17] cannot find symbol
[ERROR] symbol: class HttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[33,45] cannot find symbol
[ERROR] symbol: class DefaultHttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[34,17] cannot find symbol
[ERROR] symbol: class HttpGet
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[34,39] cannot find symbol
[ERROR] symbol: class HttpGet
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[38,25] cannot find symbol
[ERROR] symbol: class HttpResponse
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[41,26] cannot find symbol
[ERROR] symbol: class ClientProtocolException
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[58,17] cannot find symbol
[ERROR] symbol: class HttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[58,45] cannot find symbol
[ERROR] symbol: class DefaultHttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[59,17] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[59,41] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[63,25] cannot find symbol
[ERROR] symbol: class HttpResponse
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[65,26] cannot find symbol
[ERROR] symbol: class ClientProtocolException
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[79,17] cannot find symbol
[ERROR] symbol: class HttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[79,45] cannot find symbol
[ERROR] symbol: class DefaultHttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[81,17] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[81,41] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[85,25] cannot find symbol
[ERROR] symbol: class StringEntity
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[85,57] cannot find symbol
[ERROR] symbol: class StringEntity
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[86,57] cannot find symbol
[ERROR] symbol: class BasicHeader
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[86,69] cannot find symbol
[ERROR] symbol: variable HTTP
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[89,25] cannot find symbol
[ERROR] symbol: class HttpResponse
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[93,26] cannot find symbol
[ERROR] symbol: class ClientProtocolException
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[109,17] cannot find symbol
[ERROR] symbol: class HttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[109,45] cannot find symbol
[ERROR] symbol: class DefaultHttpClient
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[111,17] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[111,41] cannot find symbol
[ERROR] symbol: class HttpPost
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[115,25] cannot find symbol
[ERROR] symbol: class StringEntity
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[115,57] cannot find symbol
[ERROR] symbol: class StringEntity
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[116,57] cannot find symbol
[ERROR] symbol: class BasicHeader
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[116,69] cannot find symbol
[ERROR] symbol: variable HTTP
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[119,25] cannot find symbol
[ERROR] symbol: class HttpResponse
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[124,26] cannot find symbol
[ERROR] symbol: class ClientProtocolException
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[140,25] cannot find symbol
[ERROR] symbol: class HttpEntity
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] /home/bean/opt/src/main/java/com/trident/service/Salesforce/HttpService.java:[157,25] cannot find symbol
[ERROR] symbol: variable EntityUtils
[ERROR] location: class com.trident.service.Salesforce.HttpService
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

有趣的是,我有 jenkins 工作,它提取最新的代码并运行相同的 mvn clean install 并且它可以工作。

为什么我无法手动执行此操作?我还尝试使用相同的构建步骤创建另一个 Jenkins 作业。为此,它也给出了同样的错误。

这是我的pom.xml

<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.trident</groupId>
<artifactId>opt</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>

<!-- <properties>
<org.springframework-version>4.3.4.RELEASE</org.springframework-version>
<org.hibernate.version>5.2.6.Final</org.hibernate.version>
</properties> -->



<properties>
<springframework.version>4.3.4.RELEASE</springframework.version>
<springsecurity.version>4.0.4.RELEASE</springsecurity.version>
<hibernate.version>5.2.6.Final</hibernate.version>
<mysql.connector.version>6.0.5</mysql.connector.version>
</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>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</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>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${springsecurity.version}</version>
</dependency>


<!-- Hibernate -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>

<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.version}</version>
</dependency>

<!-- jsr303 validation -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>5.1.3.Final</version>
</dependency>


<!-- SLF4J/Logback -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
</dependency>

<!-- Servlet+JSP+JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>

<!-- JSON dependencies -->

<!-- https://mvnrepository.com/artifact/com.googlecode.json-simple/json-simple -->
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>

<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>


<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.7</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.7</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.sun.mail/javax.mail -->
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.6</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.springframework.ldap/spring-ldap-core -->
<dependency>
<groupId>org.springframework.ldap</groupId>
<artifactId>spring-ldap-core</artifactId>
<version>2.3.1.RELEASE</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-commons -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
<version>1.13.3.RELEASE</version>
</dependency>

<!-- https://mvnrepository.com/artifact/log4j/log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</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>
<warSourceDirectory>src/main/webapp</warSourceDirectory>
<warName>opt</warName>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<finalName>opt</finalName>
</build>
</project>

最佳答案

看起来您错过了 apache 的 http-Client 作为依赖项。

将其添加到您的 pom 中:

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.3</version>
</dependency>

关于java - 构建 war 文件时出现编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44819562/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com