1. 程式人生 > >intellij idea marven已經匯入包但是檔案中提示找不到該包

intellij idea marven已經匯入包但是檔案中提示找不到該包

在自己的專案中新增JUnit,編寫測試用例的時候顯示can not resolve RunWith,can not resolve Test:

試過invalidate restart和marven—> reinport,但是一樣,最後查詢了pom檔案匯入jar的語句發現了問題:

<scope>欄位用以指出開發時用或測試時用到該jar,正式部署不會匯入該jar,而把這行註釋掉以後,問題就能解決,

end