Jenkins无法为我的Selenium项目编译Maven

问题描述 投票:0回答:1

我正在尝试在Maven上安排我的项目。它使用Apache POI。 Project在我的笔记本电脑上可以正常工作,但是无法在我们办公室的远程计算机上的Jenkins上编译Maven。我遇到的错误是:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile** (default-testCompile) on project GunAV-test-automation: Compilation failure: Compilation failure:
[ERROR] /C:/Program Files (x86)/Jenkins/workspace/Mytest/-42/src/test/java/utilities/ReadExcel.java:[11,37] **package org.apache.poi.xssf.usermodel does not exist**

[ERROR] /C:/Program Files (x86)/Jenkins/workspace/Mytest/-42/src/test/java/utilities/ReadExcel.java:[12,37] package org.apache.poi.xssf.usermodel does not exist**

[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

我该如何解决此问题?

java maven selenium jenkins apache-poi
1个回答
0
投票

解决编译错误

package org.apache.poi.xssf.usermodel does not exist

您应该添加poi-ooxml maven依赖项:

<dependency>
  <groupId>org.apache.poi</groupId>
  <artifactId>poi-ooxml</artifactId>
  <version>4.1.2</version>
</dependency>

此依赖项包含org.apache.poi.xssf.usermodel程序包。

© www.soinside.com 2019 - 2024. All rights reserved.