Проект Selenium-Maven-Java не запущен - плагин Surefire - PullRequest
0 голосов
/ 24 октября 2018

У меня есть следующая строка:

Проект Selenium-Maven-Java не запущен - ошибка плагина Surefire.

Я строю свой проект по кругу ci и получаю эту ошибку сборки.
Пожалуйста, предложите, как я могу это исправить.

Пока это мой код:

$#!/bin/bash -eo pipefail
mvn -o test

И вот результат:

    [INFO] Scanning for projects...
    [WARNING] 
    [WARNING] Some problems were encountered while building the effective model for UV:UV:jar:0.0.1-SNAPSHOT
    [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.uncommons:reportng:jar -> duplicate declaration of version 1.1.4 @ line 90, column 13
    [WARNING] 
    [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
    [WARNING] 
    [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
    [WARNING] 
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building UV 0.0.1-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [WARNING] The POM for org.testng:testng:jar:5.14.3 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
    [WARNING] The POM for com.beust:jcommander:jar:1.66 is missing, no dependency information available
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ UBrew ---
    [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] Copying 1 resource
    [INFO] 
    [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ UBrew ---
    [INFO] No sources to compile
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ UV ---
    [WARNING] Using platform encoding (ANSI_X3.4-1968 actually) to copy filtered resources, i.e. build is platform dependent!
    [INFO] skip non existing resourceDirectory /home/seluser/repo/src/test/resources
    [INFO] 
    [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ UBrew ---
    [INFO] Changes detected - recompiling the module!
    [WARNING] File encoding has not been set, using platform encoding ANSI_X3.4-1968, i.e. build is platform dependent!
    [INFO] Compiling 14 source files to /home/seluser/repo/target/test-classes
    [INFO] 
    [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ UBrew ---
    [WARNING] Missing POM for org.apache.maven.surefire:surefire-testng:jar:2.22.1
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.310 s
    [INFO] Finished at: 2018-10-24T11:37:06+00:00
    [INFO] Final Memory: 28M/906M
    [INFO] 

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project UBrew: Unable to generate classpath: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
    [ERROR] ----------
    [ERROR] 1) org.apache.maven.surefire:surefire-testng:jar:2.22.1
    [ERROR] 
    [ERROR] Try downloading the file manually from the project website.
    [ERROR] 
    [ERROR] Then, install it using the command:
    [ERROR] mvn install:install-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-testng -Dversion=2.22.1 -Dpackaging=jar -Dfile=/path/to/file
    [ERROR] 
    [ERROR] Alternatively, if you host your own repository you can deploy the file there:
    [ERROR] mvn deploy:deploy-file -DgroupId=org.apache.maven.surefire -DartifactId=surefire-testng -Dversion=2.22.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
    [ERROR] 
    [ERROR] Path to dependency:
    [ERROR] 1) dummy:dummy:jar:1.0
    [ERROR] 2) org.apache.maven.surefire:surefire-testng:jar:2.22.1
    [ERROR] 
    [ERROR] ----------
    [ERROR] 1 required artifact is missing.
    [ERROR] 
    [ERROR] for artifact:
    [ERROR] dummy:dummy:jar:1.0
    [ERROR] 
    [ERROR] from the specified remote repositories:
    [ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
    [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/MojoExecutionException
    Exited with code 1

version: 2:
  jobs:
    qa-locally:
  docker:
    - image: selenium/standalone-chrome:3.1.0
  working_directory: ~/repo

steps:
  - run:
      name: Update repositories
      command: sudo apt-get update -y
  - run:
      name: Install Maven
      command: sudo apt-get install maven -y
  - run:
      name: Maven Home
      command: echo 'export MAVEN_HOME="/usr/share/maven"' >> ~/.bashrc
  - run:
      name: Path maven bin
      command: echo 'export PATH="$MAVEN_HOME/bin:$PATH"' >> ~/.bashrc
  - run:
      name: Install TestNG
      command: sudo apt-get install testng -y
  - run:
      name: Install Java
      command: sudo apt-get install default-jdk -y
  - run:
      name: Check java version
      command: java -version
  - run:
      name: Check javac version
      command: javac -version
  - run:
      name: Show java folder
      command: ls -al /usr/lib/jvm
  - run:
      name: Set java home
      command: echo 'export JAVA_HOME="/usr/lib/jvm/java-1.8.0-openjdk-amd64"' >> ~/.bashrc
  - run:
      name: Set java bin
      command: echo 'export PATH="$JAVA_HOME/bin:$PATH"' >> ~/.bashrc
  - checkout
  - run:
      name: Show files
      command: ls -al
  - run:
      name: Check MVN version
      command: mvn -version
  - run:
      name: Show files in Drivers folder
      command: ls -al Drivers
  - run:
      name: Make chromedriver executable
      command: sudo chmod +x Drivers/chromedriver
  - run:
      name: Run/install non-ui commands
      command: sudo Xvfb :10 -ac &
  - run:
      name: Set DISPLAY export
      command: export DISPLAY=:10
  - run:
      name: Run maven DskipTests
      command: mvn -DskipTests clean install
  - run:
      name: MVN Test
      command: mvn -o test

См. эту ссылку .
Мои рабочие процессы:

version: 2
test-and-build-image:
  jobs:
    - qa-locally

1 Ответ

0 голосов
/ 01 ноября 2018

Я недавно решил мою проблему верной зависимости со следующим XML.Я вижу, что вы получаете верную ошибку, а также.Обязательно оставьте здесь свой pom.xml, чтобы мы могли помочь.

-

org.apache.maven.plugins

maven-surefire-plugin

2.21.0

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...