Java Can';t在CircleCI上本地安装Selenium

Java Can';t在CircleCI上本地安装Selenium,java,maven,selenium,circleci,circleci-2.0,Java,Maven,Selenium,Circleci,Circleci 2.0,我想在应用程序中使用Selenium,但CircleCI有一些问题 我在lib/文件夹中有3个jar文件:client-combined-3.14.0.jar、htmlunit-driver-2.32.1-jar-with-dependencies.jar和core.jar 前两个jar用于Selenium库,第三个jar是用于控制的处理语言核心jar 这是我的.circleci/config.yml: version: 2 jobs: build: docker: #

我想在应用程序中使用Selenium,但CircleCI有一些问题

我在lib/文件夹中有3个jar文件:client-combined-3.14.0.jar、htmlunit-driver-2.32.1-jar-with-dependencies.jar和core.jar

前两个jar用于Selenium库,第三个jar是用于控制的处理语言核心jar

这是我的.circleci/config.yml:

version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/openjdk:8-jdk

      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at https://circleci.com/docs/2.0/circleci-images/
      # - image: circleci/postgres:9.4
    branches:
      only:
        - develop

    working_directory: ~/repo

    environment:
      # Customize the JVM maximum heap limit
      MAVEN_OPTS: -Xmx3200m

    steps:
      - checkout

      # installing packages
      - run: mvn install:install-file -Dfile="lib/client-combined-3.14.0.jar" -DgroupId="com.openqa" -DartifactId="selenium" -Dversion="3.14.0" -Dpackaging=jar -DgeneratePom=true
      - run: mvn install:install-file -Dfile="lib/htmlunit-driver-2.32.1-jar-with-dependencies.jar" -DgroupId="com.openqa.selenium" -DartifactId="htmlunit" -Dversion="2.32.1" -Dpackaging=jar -DgeneratePom=true
      - run: mvn install:install-file -DgroupId="processing" -DartifactId="core" -Dversion="3.3.7" -Dpackaging=jar -Dfile="lib/core.jar" -DgeneratePom=true

      # run tests!
      - run: echo "Testing"
      - run: mvn test
这是我的pom.xml:


4.0.0
com.157239n
利基发现者
1.0-快照
org.apache.maven.plugins
maven编译器插件
7.
7.
org.apache.maven.plugins
maven surefire插件
2.19.1
org.junit.platform
junit平台surefire提供程序
1.1.0
org.junit.jupiter
朱尼特木星发动机
5.1.0
org.junit.jupiter
JUnitJupiter api
5.1.0
测试
朱尼特
朱尼特
3.8.1
测试
org.openqa
硒
3.14.0
org.openqa.selenium
htmlunit
2.32.1
处理
核心
3.3.7

我尽量不依赖从maven存储库下载的jar文件,也不直接使用存储库

然后我不完全安装本地jar文件,只安装controlled core.jar并将pom.xml的一部分更改为

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.14.0</version>
</dependency>

<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-htmlunit-driver</artifactId>
    <version>2.52.0</version>
</dependency>

org.seleniumhq.selenium
硒爪哇
3.14.0
org.seleniumhq.selenium
selenium htmlunit驱动程序
2.52.0

然后一切都正常运行。

在三个
mvn install
命令中是否有有用的控制台输出?有任何错误吗?只需搜索我希望失败的依赖项可能不是最新的或不正确的MVN安装命令看起来不错。