[英]Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test
[英]Running maven test on a specific class - [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test
得到以下問題。 當我運行mvn test -Dtest=MyClassTest
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test
(default-test) on project my-project: No tests were executed! (Set -DfailIfNoTests=false to
ignore this error.) -> [Help 1]
但是我在同一項目中有10個其他類,但是路徑不同。 我像這樣跑所有的人,一切都很好。 但是mvn測試不僅僅可以識別這一點。 可能有什么問題嗎?
我檢查了人們遇到的相同錯誤,但是提出了不同的解決方案,例如升級等。但是對我來說,除此測試外,所有測試都運行良好。 因此,如果我缺少某些東西,我會陷入困境。
對於那些有相同問題的人。 這是我的失誤(也許)。 @Test
注釋的方法沒有訪問說明符。 我只是使用void method()。 我添加了public
,它開始起作用!
感謝@ user2507946。 從IDE運行有助於解決該問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.