【问题标题】:Browserstack automate-maven-plugin not workingBrowserstack 自动化 Maven 插件不工作
【发布时间】:2020-08-25 02:55:52
【问题描述】:

我正在尝试使用 Jenkins 在 BrowserStack 设备云上运行我的 appium 测试。

将依赖项添加到下一节中提到的我的 pom.xml 之后 https://www.browserstack.com/app-automate/appium/jenkins#reporting

我收到以下错误:

[ERROR] Failed to execute goal com.browserstack:automate-maven-plugin:1.0.0-SNAPSHOT:test-compile (default) on project 1.0: Execution default of goal com.browserstack:automate-maven-plugin:1.0.0-SNAPSHOT:test-compile failed: Plugin com.browserstack:automate-maven-plugin:1.0.0-SNAPSHOT or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.codehaus.mojo:aspectj-maven-plugin:jar:${aspectj.maven.version}, org.aspectj:aspectjtools:jar:${aspectj.tools.version}: Could not find artifact org.codehaus.mojo:aspectj-maven-plugin:jar:${aspectj.maven.version} in central (https://repo.maven.apache.org/maven2) -> [Help 1]

我的 pom.xml 文件:

<?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>xxxx</groupId>
<artifactId>1.0</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <jdk.source.version>1.8</jdk.source.version>
    <jdk.target.version>1.8</jdk.target.version>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.0</version>
            <configuration>
                <source>${jdk.source.version}</source>
                <target>${jdk.target.version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <!-- JUnit 5 requires Surefire version 2.22.0 or higher -->
            <version>2.22.0</version>
        </plugin>
        <plugin>
            <groupId>com.browserstack</groupId>
            <artifactId>automate-maven-plugin</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <configuration>
                <source>${jdk.source.version}</source>
                <target>${jdk.target.version}</target>
                <complianceLevel>${jdk.source.version}</complianceLevel>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>test-compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <!-- https://mvnrepository.com/artifact/io.appium/java-client -->
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>7.2.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>5.5.2</version>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine -->
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.5.2</version>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.browserstack/automate-testassist -->
    <dependency>
        <groupId>com.browserstack</groupId>
        <artifactId>automate-testassist</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </dependency>
</dependencies>

谁能帮我解决这个问题?

【问题讨论】:

    标签: maven jenkins pom.xml browserstack


    【解决方案1】:
                <source>${jdk.source.version}</source>
                <target>${jdk.target.version}</target>
                <complianceLevel>${jdk.source.version}</complianceLevel>
    

    您需要在此处提及 jdk 源和目标版本。

    【讨论】:

      【解决方案2】:

      这是因为 BrowserStack 存储库不再具有快照功能,因此您需要包含插件,如下所示。您可以查看this answer 了解更多关于快照的信息

      <groupId>com.browserstack</groupId>
      <artifactId>automate-maven-plugin</artifactId>
      <version>1.0.0</version>
      

      没有快照

      【讨论】:

        猜你喜欢
        • 2012-01-05
        • 2012-09-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-06-08
        • 1970-01-01
        相关资源
        最近更新 更多