背景
在执行mvn test的时候,提示package org.testng.annotations does not exist
解决办法
- Open pom.xml file.
- Go to "Dependencies" tab.
- Select "testng" package and click on "Properties..."
- On opened screen change "Scope" option to "compile" and click "OK" to save it.
- Try to build your project again with "compile test" goals.
- 源文档 <http://stackoverflow.com/questions/20345451/maven-compilation-error-package-org-testng-annotations-does-not-exist>
- 将scope的test修改为compile