在項目的.classpath文件中增加如下紅色的配置即可解決明明已經引入了scope爲test的依賴,但是單元測試代碼卻依然提示類型不存在
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>