【问题标题】:Jenkins fails to compile Maven for my Selenium ProjectJenkins 无法为我的 Selenium 项目编译 Maven
【发布时间】:2020-02-14 10:47:43
【问题描述】:

我正在尝试在 Maven 上安排我的项目。它使用 Apache POI。项目在我的笔记本电脑上运行良好,但无法在我们办公室远程机器上的 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

我该如何解决这个问题?

【问题讨论】:

  • POM 文件中有org.apache.poi 依赖吗?
  • 是的,它看起来像:org.apache.poipoi4.1.1

标签: java maven selenium jenkins apache-poi


【解决方案1】:

修复编译错误

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 包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-04
    • 2015-01-07
    • 2014-08-18
    • 2021-07-23
    • 2011-03-05
    • 2022-08-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多