作为作业Azure运行时,io.cucumber.junit软件包不存在

时间:2020-11-05 12:13:37

标签: java maven junit cucumber azure-pipelines-yaml

我是管道作业的@Beginner级别,使用maven进行构建 代码按预期方式在本地运行(黄瓜+ Junit),但在定义为Job

时失败

得到以下错误 [错误] /D:/a/1/s/src/main/java/com/automationmth/runner/RunnerTest.java:[33,25]包io.cucumber.junit不存在 [错误] /D:/a/1/s/src/main/java/com/automationmth/runner/RunnerTest.java:[35,25]包io.cucumber.junit不存在 [错误] /D:/a/1/s/src/main/java/com/automationmth/runner/RunnerTest.java:[38,2]找不到符号 符号:类CucumberOptions [错误] /D:/a/1/s/src/main/java/com/automationmth/runner/RunnerTest.java:[37,10]找不到符号 符号:黄瓜类

Runner文件确实具有 进口io.cucumber.junit.Cucumber; 导入io.cucumber.junit.CucumberOptions;

Yaml文件> 触发: -主控

池: vmImage:'windows-2019'

步骤:

  • 任务:Maven @ 3 输入: mavenPomFile:'pom.xml' 目标:“测试” mavenOptions:“-Xmx3072m” javaHomeOption:“ JDKVersion” jdkVersionOption:'1.8' jdkArchitectureOption:'x64' publishJUnitResults:正确 testResultsFiles:“ ** / surefire-reports / TEST-*。xml”

POM

  <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-jvm -->
            <dependency>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-jvm</artifactId>
                <version>4.8.1</version>
                <type>pom</type>
            </dependency>

        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
                
        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java8 -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java8</artifactId>
            <version>4.8.1</version>
        </dependency>

        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
              <configuration>
                 <properties>
                    <property>
                      <name>junit</name>
                       <value>true</value>
                         </property>
                          </properties>
                  <includes>
                <include>**/*RunnerTest.java</include>
            </includes>
            </configuration>
        </plugin>

有人可以提出建议,以便我尝试解决此错误。

谢谢。

0 个答案:

没有答案