第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

通過可執(zhí)行 JAR 從 cmdline 執(zhí)行 Cucumber 測試,無需 Maven

通過可執(zhí)行 JAR 從 cmdline 執(zhí)行 Cucumber 測試,無需 Maven

弒天下 2023-10-13 16:44:55
以下是執(zhí)行的步驟:第 1 步: 基于此,我構(gòu)建了一個獨立的 jar,其中包含使用maven-shade-plugin.pom.xml<build>    <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-surefire-plugin</artifactId>            <version>2.22.2</version>            <configuration>                <testFailureIgnore>true</testFailureIgnore>                <testSourceDirectory>${basedir}/src/main/java/</testSourceDirectory>                <testClassesDirectory>${project.build.directory}/classes/</testClassesDirectory>                <reportsDirectory>${project.build.directory}/test-output/${timestamp}</reportsDirectory>            </configuration>        </plugin>        <!-- https://maven.apache.org/plugins/maven-shade-plugin/examples/executable-jar.html -->        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-shade-plugin</artifactId>            <version>3.2.1</version>            <executions>                <execution>                    <phase>package</phase>                    <goals>                        <goal>shade</goal>                    </goals>                    <configuration>                        <!-- https://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html -->                        <shadedArtifactAttached>true</shadedArtifactAttached>                        <shadedClassifierName>standalone</shadedClassifierName>                        <transformers>                            <!-- https://maven.apache.org/plugins/maven-shade-plugin/examples/resource-transformers.html -->                                <mainClass>runners.RunCukesTest</mainClass>                            </transformer>                        </transformers>                    </configuration>                </execution>            </executions>        </plugin>    </plugins></build>將該main()方法添加到 runner 類中,并根據(jù)this、this和this傳遞 cmdline 參數(shù)。
查看完整描述

1 回答

?
蠱毒傳說

TA貢獻1895條經(jīng)驗 獲得超3個贊

您傳遞了 Cucumber 的相對路徑src\main\resources\features。因為您正在執(zhí)行 Jar,所以該相對路徑將使用當(dāng)前工作目錄轉(zhuǎn)換為絕對路徑。但是,因為src\main\resources\features是您的功能的源文件夾,所以找不到任何內(nèi)容,您會得到:

線程“main”中的異常 java.lang.IllegalArgumentException:不是文件或目錄:\path\to\jar\src\main\resources\features

相反,您必須告訴 Cucumber 您的功能位于類路徑上。您可以通過以下方式執(zhí)行此操作:

"classpath:features"


查看完整回答
反對 回復(fù) 2023-10-13
  • 1 回答
  • 0 關(guān)注
  • 107 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號