亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

無法執行目標 org.apache.maven.plugins:maven-

無法執行目標 org.apache.maven.plugins:maven-

侃侃無極 2024-01-05 10:43:06
我正在嘗試用JAVA學習Selemnium。當我使用命令“mvn test”時出現以下錯誤。無法執行目標 org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test<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/maven-v4_0_0.xsd">  <modelVersion>4.0.0</modelVersion>  <groupId>org.tchateau.mavenTest</groupId>  <artifactId>TestMaven</artifactId>  <packaging>jar</packaging>  <version>1.0-SNAPSHOT</version>  <name>TestMaven</name>  <url>http://maven.apache.org</url>  <build>    <pluginManagement>      <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-surefire-plugin</artifactId>            <version>3.0.0-M3</version>            <configuration>              <suiteXmlFiles>                <suiteXmlFile>testng.xml</suiteXmlFile>              </suiteXmlFiles>            </configuration>        </plugin>      </plugins>    </pluginManagement>  </build>  <dependencies>    <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->    <dependency>        <groupId>org.seleniumhq.selenium</groupId>        <artifactId>selenium-java</artifactId>        <version>3.141.59</version>    </dependency>    <!-- https://mvnrepository.com/artifact/org.testng/testng -->    <dependency>        <groupId>org.testng</groupId>        <artifactId>testng</artifactId>        <version>6.14.3</version>        <scope>test</scope>    </dependency>我嘗試過命令: mvn dependency::tree 并且刷新了我的項目 eclipse。我嘗試過更改版本的肯定但沒有結果。你有什么想法嗎?Stackoverflow 上已經存在的主題對我沒有更多幫助。
查看完整描述

4 回答

?
慕的地8271018

TA貢獻1796條經驗 獲得超4個贊

這是我的testng.xml


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">

<suite name="Suite">

  <test thread-count="5" name="Test">

    <classes>

      <class name="org.tchateau.mavenTest.RESTAPITest"/>

      <class name="org.tchateau.mavenTest.SeleniumTest"/>

      <class name="org.tchateau.mavenTest.AppiumTest"/>

    </classes>

  </test> <!-- Test -->

</suite> <!-- Suite -->

使用eclipse生成testng.xml時右鍵> TestNG > Convert to TestNG


Eclipse 寫:<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">


它是:<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">


(https -> http)


查看完整回答
反對 回復 2024-01-05
?
12345678_0001

TA貢獻1802條經驗 獲得超5個贊

您是否嘗試過強制更新快照?運行下面的命令將重新下載所有依賴項,也會忽略測試失敗希望這會有所幫助。

mvn clean install -U -Dmaven.test.failure.ignore=true


查看完整回答
反對 回復 2024-01-05
?
德瑪西亞99

TA貢獻1770條經驗 獲得超3個贊

將以下內容添加到您的 Surefire 插件配置中


<configuration>

    <testFailureIgnore>true</testFailureIgnore>

</configuration>


查看完整回答
反對 回復 2024-01-05
?
catspeake

TA貢獻1111條經驗 獲得超0個贊

如果您正在使用 testNg 依賴項,并且您已從以下選項創建了 testng.xml 或任何套件文件 -

anytestNg 測試類 ->右鍵單擊 -> 選擇TestNg ->轉換為 TestNG
然后
打開testng.xml,如果您可以看到 - HTTP 而不是 HTTPS

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

從HTTP -> HTTPS進行更改

<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">


查看完整回答
反對 回復 2024-01-05
  • 4 回答
  • 0 關注
  • 230 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號