首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AWS设备场: APPIUM_JAVA_JUNIT_TEST_PACKAGE_CLASS_FILE_MISSING_IN_TESTS_JAR

AWS设备场: APPIUM_JAVA_JUNIT_TEST_PACKAGE_CLASS_FILE_MISSING_IN_TESTS_JAR
EN

Stack Overflow用户
提问于 2018-10-23 09:52:58
回答 1查看 303关注 0票数 0

我正在尝试上传Appium测试到AWS设备场。我将我的pom.xml文件配置如下:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<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">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.acme</groupId>
   <artifactId>acme-android-appium</artifactId>
   <version>1.0-SNAPSHOT</version>
   <packaging>jar</packaging>
       <repositories>
            <repository>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </releases>
            <id>Experitest.repo1</id>
            <name>YourName</name>
            <url>https://cloud.experitest.com/repo/</url>
            <layout>default</layout>
        </repository>
    </repositories>
   <build>
      <sourceDirectory>src</sourceDirectory>
      <plugins>
         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
               <source>1.8</source>
               <target>1.8</target>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
                <classesDirectory>dummy</classesDirectory>
            </configuration>
            <version>2.6</version>
            <executions>
               <execution>
                  <goals>
                     <goal>test-jar</goal>
                  </goals>
               </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>
            <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>
      </plugins>
   </build>
   <dependencies>
      <dependency>
         <groupId>com.amazonaws</groupId>
         <artifactId>aws-lambda-java-core</artifactId>
         <version>1.1.0</version>
      </dependency>
      <!-- extentreports -->
      <dependency>
         <groupId>com.relevantcodes</groupId>
         <artifactId>extentreports</artifactId>
         <version>2.41.2</version>
      </dependency>
      <dependency>
         <groupId>com.experitest</groupId>
         <artifactId>appium</artifactId>
         <version>4.1.2</version>
      </dependency>
   </dependencies>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>

当我试图用maven编译我的代码时(通过CMD命令: mvn干净包-DskipTests=true),我得到了一些信息行,包括以下信息:

警告/C:/User/Adam Peretz/workspace/Sweetch/src/Utilites/CommonOps.java:一些输入文件使用未经检查或不安全的操作。 警告/C:/User/Adam Peretz/workspace/Sweetch/src/Utilites/CommonOps.java:使用-Xlint:unchecked重新编译以获得详细信息。 警告JAR将为空-没有内容被标记为包含! 信息建设成功

之后,我将"zip-with-dependencies.zip“文件上传到AWS设备场,并得到了以下错误:

处理你的文件有问题。我们在测试JAR文件中找不到类文件。请解压缩测试包,然后解压测试JAR文件,验证JAR文件中至少有一个类文件,然后再试一次。有关此问题的更多信息,请参见文档

我该怎么办?我真的不知道该怎么做,我什么都试过了。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-10-23 12:47:27

你把Java文件放哪儿了?警告返回到默认情况下在maven中创建的jar文件,而不是*-test.jar

设备场使用*-test.jar文件,错误消息表明它是空的。测试Java文件是否在./src/ test /java下面?否则,maven将不会将这些类文件打包到*-test.jar中。

下面是一个比较的例子。

https://github.com/aws-samples/aws-device-farm-appium-tests-for-sample-app

希望这有帮助

詹姆斯

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52946132

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档