无法使用Java TestNG项目解决AWS设备场中的依赖项 - jar错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了无法使用Java TestNG项目解决AWS设备场中的依赖项 - jar错误相关的知识,希望对你有一定的参考价值。

我正在尝试使用Selenium将我的zip-with-dependencies加载到AWS TestNG项目的AWS设备场。

每当我将.zip上传到AWS设备场时,我都会收到消息:“处理文件时出现问题。我们无法在测试包的根目录中找到dependency-jars目录。请解压缩您的测试包,验证dependency-jars目录位于包的根目录中,然后再试一次。“

我用“树”检查了目标文件夹中的树。我得到了:

.
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT-tests.jar
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
├── archive-tmp
├── classes
├── dependency-jars
│   ├── aether-api-1.7.jar
│   ├── aether-impl-1.7.jar
│   ├── aether-spi-1.7.jar
│   ├── aether-util-1.7.jar
│   ├── animal-sniffer-annotations-1.14.jar
│   ├── ant-1.10.3.jar
│   ├── ant-launcher-1.10.3.jar
│   ├── asm-6.2.1.jar
│   ├── aspectjweaver-1.9.1.jar
│   ├── bridj-0.6.2.jar
│   ├── bsh-2.0b6.jar
│   ├── byte-buddy-1.8.15.jar
│   ├── cglib-3.2.8.jar
│   ├── checker-compat-qual-2.0.0.jar
│   ├── commons-beanutils-1.9.2.jar
│   ├── commons-cli-1.2.jar
│   ├── commons-codec-1.10.jar
│   ├── commons-collections-3.2.2.jar
│   ├── commons-compress-1.18.jar
│   ├── commons-digester-1.8.1.jar
│   ├── commons-exec-1.3.jar
│   ├── commons-io-2.6.jar
│   ├── commons-lang3-3.8.jar
│   ├── commons-logging-1.2.jar
│   ├── commons-validator-1.6.jar
│   ├── cucumber-core-1.2.5.jar
│   ├── cucumber-html-0.2.3.jar
│   ├── cucumber-java-1.2.5.jar
│   ├── cucumber-jvm-deps-1.0.5.jar
│   ├── cucumber-testng-1.2.5.jar
│   ├── error_prone_annotations-2.1.3.jar
│   ├── gherkin-2.12.2.jar
│   ├── gson-2.8.5.jar
│   ├── guava-25.0-jre.jar
│   ├── httpclient-4.5.6.jar
│   ├── httpcore-4.4.10.jar
│   ├── j2objc-annotations-1.1.jar
│   ├── java-client-7.0.0.jar
│   ├── jcommander-1.72.jar
│   ├── jintellitype-1.3.7.jar
│   ├── jsr305-1.3.9.jar
│   ├── jxgrabkey-1.0.jar
│   ├── maven-aether-provider-3.0.jar
│   ├── maven-archiver-3.3.0.jar
│   ├── maven-artifact-3.0.jar
│   ├── maven-core-3.0.jar
│   ├── maven-jar-plugin-3.1.1.jar
│   ├── maven-model-3.0.jar
│   ├── maven-model-builder-3.0.jar
│   ├── maven-plugin-api-3.0.jar
│   ├── maven-repository-metadata-3.0.jar
│   ├── maven-settings-3.0.jar
│   ├── maven-settings-builder-3.0.jar
│   ├── maven-shared-utils-3.2.1.jar
│   ├── okhttp-3.11.0.jar
│   ├── okio-1.14.0.jar
│   ├── plexus-archiver-3.7.0.jar
│   ├── plexus-cipher-1.4.jar
│   ├── plexus-classworlds-2.2.3.jar
│   ├── plexus-component-annotations-1.5.5.jar
│   ├── plexus-interpolation-1.14.jar
│   ├── plexus-io-3.1.0.jar
│   ├── plexus-sec-dispatcher-1.3.jar
│   ├── plexus-utils-3.1.0.jar
│   ├── selenium-api-3.141.59.jar
│   ├── selenium-chrome-driver-3.141.59.jar
│   ├── selenium-edge-driver-3.141.59.jar
│   ├── selenium-firefox-driver-3.141.59.jar
│   ├── selenium-ie-driver-3.141.59.jar
│   ├── selenium-java-3.141.59.jar
│   ├── selenium-opera-driver-3.141.59.jar
│   ├── selenium-remote-driver-3.141.59.jar
│   ├── selenium-safari-driver-3.141.59.jar
│   ├── selenium-support-3.141.59.jar
│   ├── sikulixapi-1.1.0.jar
│   ├── sikulixlibsmac-1.1.0.jar
│   ├── sisu-guice-2.1.7-noaop.jar
│   ├── sisu-inject-bean-1.4.2.jar
│   ├── sisu-inject-plexus-1.4.2.jar
│   ├── slf4j-api-1.7.25.jar
│   ├── snappy-0.4.jar
│   ├── spring-aop-5.1.0.RELEASE.jar
│   ├── spring-beans-5.1.0.RELEASE.jar
│   ├── spring-context-5.1.0.RELEASE.jar
│   ├── spring-core-5.1.0.RELEASE.jar
│   ├── spring-expression-5.1.0.RELEASE.jar
│   ├── spring-jcl-5.1.0.RELEASE.jar
│   ├── swing-layout-1.0.3.jar
│   ├── testng-6.14.3.jar
│   └── xz-1.8.jar
├── generated-test-sources
│   └── test-annotations
├── maven-archiver
│   └── pom.properties
├── maven-status
│   └── maven-compiler-plugin
│       ├── compile
│       │   └── default-compile
│       │       └── inputFiles.lst
│       └── testCompile
│           └── default-testCompile
│               ├── createdFiles.lst
│               └── inputFiles.lst
├── test-classes
│   ├── Locators
│   │   ├── AdvisorAEPOhio.class
│   │   ├── AdvisorBlueprint.class
│   │   ├── AdvisorDTE.class
│   │   ├── DemandResponseCardBlueprint.class
│   │   ├── DemandResponseNotificationBlueprint.class
│   │   ├── DevicesBlueprint.class
│   │   ├── HamburgerAEPOhio.class
│   │   ├── HamburgerBlueprint.class
│   │   ├── HamburgerDTE.class
│   │   ├── HomeAEPOhio.class
│   │   ├── HomeBlueprint.class
│   │   ├── HomeCardsAEPOhio.class
│   │   ├── HomeCardsBlueprint.class
│   │   ├── HomeCardsDTE.class
│   │   ├── HomeDTE.class
│   │   ├── LightBlueprint.class
│   │   ├── LoginAEPOhio.class
│   │   ├── LoginBlueprint.class
│   │   ├── LoginDTE.class
│   │   ├── MyPlanBlueprint.class
│   │   ├── MyPlanDTE.class
│   │   ├── ParentDeviceBlueprint.class
│   │   ├── PlugBlueprint.class
│   │   ├── PortalBlueprint.class
│   │   ├── PortalDemandResponseBlueprint.class
│   │   ├── PushApp.class
│   │   └── TstatBlueprint.class
│   ├── config
│   │   └── config.properties
│   ├── drivers
│   │   └── chromedriver
│   ├── features
│   │   ├── DemandResponse.feature
│   │   ├── EnergyTabNavigation.feature
│   │   ├── EnergyUseComparison.feature
│   │   ├── Hamburger.feature
│   │   ├── HomeAdvisor.feature
│   │   ├── Light.feature
│   │   ├── PayModel.feature
│   │   ├── Switch.feature
│   │   ├── Tstat.feature
│   │   └── loginSingle.feature
│   ├── main
│   │   └── CucumberRunner.class
│   ├── samplefeatures
│   │   └── loginMulti.feature
│   ├── stepdefinition
│   │   ├── AdvisorPage.class
│   │   ├── DemandResponseCard$1.class
│   │   ├── DemandResponseCard.class
│   │   ├── DevicesPage.class
│   │   ├── HamburgerPage.class
│   │   ├── HomeCardsPage.class
│   │   ├── HomePage.class
│   │   ├── LightPage.class
│   │   ├── LoginPage.class
│   │   ├── MyPlanPage.class
│   │   ├── ParentDevicePage.class
│   │   ├── PlugPage.class
│   │   ├── PortalDemandResponsePage.class
│   │   ├── PortalWebPage.class
│   │   ├── PushAppPage.class
│   │   └── TstatPage.class
│   └── utilities
│       ├── AppiumServer.class
│       ├── ByWrapper.class
│       ├── ByWrapperPortal.class
│       ├── DemandResponse.class
│       ├── MyUtils.class
│       └── TstatDemandResponse.class
└── zip-with-dependencies.zip

每当我将zip-with-dependencies移动到另一个目录并尝试相同的命令时,我得到:

.
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT-tests.jar
├── TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
└── zip-with-dependencies.zip

这是我最初运行mvn clean package -DskipTests = true来构建.zip时得到的

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building TestngCucumberBoilerPlate 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ TestngCucumberBoilerPlate ---
[INFO] Deleting /Users/cbellard/Documents/PowerleyAppiumCucumber/target
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/cbellard/Documents/PowerleyAppiumCucumber/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:compile (default-compile) @ TestngCucumberBoilerPlate ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ TestngCucumberBoilerPlate ---
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 13 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.2:testCompile (default-testCompile) @ TestngCucumberBoilerPlate ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 49 source files to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/test-classes
[INFO] /Users/cbellard/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Some input files use unchecked or unsafe operations.
[INFO] /Users/cbellard/Documents/PowerleyAppiumCucumber/src/test/java/main/CucumberRunner.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) @ TestngCucumberBoilerPlate ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ TestngCucumberBoilerPlate ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/cbellard/Documents/PowerleyAppiumCucumber/target/TestngCucumberBoilerPlate-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.6:test-jar (default) @ TestngCucumberBoilerPlate ---
[INFO] Building jar: /Users/cbellard/Documents/PowerleyAppiumCucumber/target/TestngCucumberBoilerPlate-0.0.1-SNAPSHOT-tests.jar
[INFO] 
[INFO] --- maven-assembly-plugin:2.5.4:single (default) @ TestngCucumberBoilerPlate ---
[INFO] Reading assembly descriptor: src/main/assembly/zip.xml
[INFO] Building zip: /Users/cbellard/Documents/PowerleyAppiumCucumber/target/zip-with-dependencies.zip
[INFO] 
[INFO] --- maven-dependency-plugin:2.10:copy-dependencies (copy-dependencies) @ TestngCucumberBoilerPlate ---
[INFO] Copying java-client-7.0.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/java-client-7.0.0.jar
[INFO] Copying byte-buddy-1.8.15.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/byte-buddy-1.8.15.jar
[INFO] Copying maven-settings-builder-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-settings-builder-3.0.jar
[INFO] Copying httpcore-4.4.10.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/httpcore-4.4.10.jar
[INFO] Copying aether-util-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-util-1.7.jar
[INFO] Copying cglib-3.2.8.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cglib-3.2.8.jar
[INFO] Copying maven-core-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-core-3.0.jar
[INFO] Copying maven-model-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-model-3.0.jar
[INFO] Copying commons-validator-1.6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-validator-1.6.jar
[INFO] Copying animal-sniffer-annotations-1.14.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/animal-sniffer-annotations-1.14.jar
[INFO] Copying maven-artifact-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-artifact-3.0.jar
[INFO] Copying jcommander-1.72.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jcommander-1.72.jar
[INFO] Copying selenium-chrome-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-chrome-driver-3.141.59.jar
[INFO] Copying selenium-opera-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-opera-driver-3.141.59.jar
[INFO] Copying commons-io-2.6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-io-2.6.jar
[INFO] Copying maven-model-builder-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-model-builder-3.0.jar
[INFO] Copying plexus-component-annotations-1.5.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-component-annotations-1.5.5.jar
[INFO] Copying maven-jar-plugin-3.1.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-jar-plugin-3.1.1.jar
[INFO] Copying maven-repository-metadata-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-repository-metadata-3.0.jar
[INFO] Copying ant-launcher-1.10.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/ant-launcher-1.10.3.jar
[INFO] Copying okio-1.14.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/okio-1.14.0.jar
[INFO] Copying spring-beans-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-beans-5.1.0.RELEASE.jar
[INFO] Copying ant-1.10.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/ant-1.10.3.jar
[INFO] Copying commons-beanutils-1.9.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-beanutils-1.9.2.jar
[INFO] Copying gson-2.8.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/gson-2.8.5.jar
[INFO] Copying selenium-support-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-support-3.141.59.jar
[INFO] Copying aether-api-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-api-1.7.jar
[INFO] Copying plexus-archiver-3.7.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-archiver-3.7.0.jar
[INFO] Copying bridj-0.6.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/bridj-0.6.2.jar
[INFO] Copying commons-logging-1.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-logging-1.2.jar
[INFO] Copying jxgrabkey-1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jxgrabkey-1.0.jar
[INFO] Copying sisu-guice-2.1.7-noaop.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sisu-guice-2.1.7-noaop.jar
[INFO] Copying plexus-utils-3.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-utils-3.1.0.jar
[INFO] Copying cucumber-html-0.2.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-html-0.2.3.jar
[INFO] Copying plexus-io-3.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-io-3.1.0.jar
[INFO] Copying asm-6.2.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/asm-6.2.1.jar
[INFO] Copying bsh-2.0b6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/bsh-2.0b6.jar
[INFO] Copying plexus-cipher-1.4.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-cipher-1.4.jar
[INFO] Copying maven-shared-utils-3.2.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-shared-utils-3.2.1.jar
[INFO] Copying okhttp-3.11.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/okhttp-3.11.0.jar
[INFO] Copying commons-lang3-3.8.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-lang3-3.8.jar
[INFO] Copying maven-archiver-3.3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-archiver-3.3.0.jar
[INFO] Copying gherkin-2.12.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/gherkin-2.12.2.jar
[INFO] Copying snappy-0.4.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/snappy-0.4.jar
[INFO] Copying selenium-remote-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-remote-driver-3.141.59.jar
[INFO] Copying maven-aether-provider-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-aether-provider-3.0.jar
[INFO] Copying spring-jcl-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-jcl-5.1.0.RELEASE.jar
[INFO] Copying jsr305-1.3.9.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jsr305-1.3.9.jar
[INFO] Copying maven-settings-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-settings-3.0.jar
[INFO] Copying checker-compat-qual-2.0.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/checker-compat-qual-2.0.0.jar
[INFO] Copying maven-plugin-api-3.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/maven-plugin-api-3.0.jar
[INFO] Copying sisu-inject-bean-1.4.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sisu-inject-bean-1.4.2.jar
[INFO] Copying selenium-ie-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-ie-driver-3.141.59.jar
[INFO] Copying testng-6.14.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/testng-6.14.3.jar
[INFO] Copying sisu-inject-plexus-1.4.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sisu-inject-plexus-1.4.2.jar
[INFO] Copying plexus-interpolation-1.14.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-interpolation-1.14.jar
[INFO] Copying j2objc-annotations-1.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/j2objc-annotations-1.1.jar
[INFO] Copying commons-compress-1.18.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-compress-1.18.jar
[INFO] Copying sikulixlibsmac-1.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sikulixlibsmac-1.1.0.jar
[INFO] Copying cucumber-jvm-deps-1.0.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-jvm-deps-1.0.5.jar
[INFO] Copying selenium-api-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-api-3.141.59.jar
[INFO] Copying spring-core-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-core-5.1.0.RELEASE.jar
[INFO] Copying selenium-java-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-java-3.141.59.jar
[INFO] Copying selenium-edge-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-edge-driver-3.141.59.jar
[INFO] Copying commons-exec-1.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-exec-1.3.jar
[INFO] Copying plexus-classworlds-2.2.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-classworlds-2.2.3.jar
[INFO] Copying commons-cli-1.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-cli-1.2.jar
[INFO] Copying commons-codec-1.10.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-codec-1.10.jar
[INFO] Copying spring-aop-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-aop-5.1.0.RELEASE.jar
[INFO] Copying error_prone_annotations-2.1.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/error_prone_annotations-2.1.3.jar
[INFO] Copying guava-25.0-jre.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/guava-25.0-jre.jar
[INFO] Copying cucumber-java-1.2.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-java-1.2.5.jar
[INFO] Copying aether-spi-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-spi-1.7.jar
[INFO] Copying plexus-sec-dispatcher-1.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/plexus-sec-dispatcher-1.3.jar
[INFO] Copying jintellitype-1.3.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/jintellitype-1.3.7.jar
[INFO] Copying cucumber-testng-1.2.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-testng-1.2.5.jar
[INFO] Copying spring-expression-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-expression-5.1.0.RELEASE.jar
[INFO] Copying commons-digester-1.8.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-digester-1.8.1.jar
[INFO] Copying commons-collections-3.2.2.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/commons-collections-3.2.2.jar
[INFO] Copying cucumber-core-1.2.5.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/cucumber-core-1.2.5.jar
[INFO] Copying xz-1.8.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/xz-1.8.jar
[INFO] Copying selenium-firefox-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-firefox-driver-3.141.59.jar
[INFO] Copying slf4j-api-1.7.25.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/slf4j-api-1.7.25.jar
[INFO] Copying swing-layout-1.0.3.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/swing-layout-1.0.3.jar
[INFO] Copying httpclient-4.5.6.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/httpclient-4.5.6.jar
[INFO] Copying sikulixapi-1.1.0.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/sikulixapi-1.1.0.jar
[INFO] Copying selenium-safari-driver-3.141.59.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/selenium-safari-driver-3.141.59.jar
[INFO] Copying spring-context-5.1.0.RELEASE.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/spring-context-5.1.0.RELEASE.jar
[INFO] Copying aether-impl-1.7.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aether-impl-1.7.jar
[INFO] Copying aspectjweaver-1.9.1.jar to /Users/cbellard/Documents/PowerleyAppiumCucumber/target/dependency-jars/aspectjweaver-1.9.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.540 s
[INFO] Finished at: 2019-02-08T14:51:24-05:00
[INFO] Final Memory: 22M/90M
[INFO] ------------------------------------------------------------------------

这是我的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">
    <repositories>
        <repository>
            <id>TestNG-Cucumber</id>
            <name>testng-cucumber</name>
            <url>https://github.com/igniteram</url>
        </repository>
    </repositories>
<packaging>jar</packaging>
    <modelVersion>4.0.0</modelVersion>
  <groupId>TestngCucumber</groupId>
  <artifactId>TestngCucumberBoilerPlate</artifactId>
  <version>0.0.1-SNAPSHOT</version>
<dependencies>
        <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency> 

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.5</version>
        </dependency>

        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>1.2.5</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.14.3</version>
        </dependency>
        <dependency>
            <groupId>io.appium</groupId>
            <artifactId>java-client</artifactId>
            <version>7.0.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.1</version>
            <type>maven-plugin</type>
        </dependency>

        <!-- Added for comparing screenshots -->
        <!-- https://mvnrepository.com/artifact/com.sikulix/sikulixapi -->
        <dependency>
            <groupId>com.sikulix</groupId>
            <artifactId>sikulixapi</artifactId>
            <version>1.1.0</version>
        </dependency>
</dependencies>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <version>2.6</version>
      <executions>
        <execution>
          <goals>
            <goal>test-jar</goal>
          </goals>
        </execution>
      </executions>
    </plugin>


    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.5.4</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <finalName>zip-with-dependencies</finalName>
                        <appendAssemblyId>false</appendAssemblyId>
                        <descriptors>
                            <descriptor>src/main/assembly/zip.xml</descriptor>
                        </descriptors>
                    </configuration>
                </execution>
            </executions>
    </plugin>


    <plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <version>2.10</version>
  <executions>
    <execution>
      <id>copy-dependencies</id>
      <phase>package</phase>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
      <configuration>
        <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
      </configuration>
    </execution>
  </executions>
</plugin>



      <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-resources-plugin</artifactId>
   <version>2.7</version>
   <dependencies>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-filtering</artifactId>
       <version>1.3</version>
     </dependency>
   </dependencies>
</plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>testng.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>
答案

我还没有完全测试过这个,但我认为构建步骤不正常。你可以尝试在maven-assemble-plugin之前首先使用maven-dependency-plugin并告诉我这是否有帮助?订单在maven中很重要。

代码段

           <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>zip-with-dependencies</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                            <descriptors>
                                <descriptor>src/main/assembly/zip.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

以上是关于无法使用Java TestNG项目解决AWS设备场中的依赖项 - jar错误的主要内容,如果未能解决你的问题,请参考以下文章

AWS 设备场似乎忽略了 TestNG 注释

在 aws-device 场中运行特定的 TestNG testng.xml 套件文件

无法读取 aws 设备场中的属性文件

无法使用 AWS 设备场打开和关闭通知面板

使用 AWS 设备场进行 XC UI 测试时出现错误“跳过设置测试:找不到足够的套件来执行”?

webdriver-io 是不是可以与 AWS 设备场一起使用?如何设置?