我有简单scala
的库代码Spoon
:
class ExtractCodeDataTest extends FlatSpec {
it should "Run and not be empty" in{
val l = new Launcher()
l.addInputResource("./testData/owasp-security-logging")
l.buildModel()
val factory = l.getFactory
val allClass = factory.Class().getAll(true)
println(allClass)
}
}
我已经从 github 克隆了开源项目,但我无法编译它。
The import org.junit cannot be resolved at /home/user/IdeaProjects/testSearch/testData/owasp-security-logging/owasp-security-logging-logback/src/test/java/org/owasp/security/logging/filter/SecurityMarkerFilterTest.java:3
spoon.compiler.ModelBuildingException: The import org.junit cannot be resolved at /home/user/IdeaProjects/testSearch/testData/owasp-security-logging/owasp-security-logging-logback/src/test/java/org/owasp/security/logging/filter/SecurityMarkerFilterTest.java:3
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.report(JDTBasedSpoonCompiler.java:583)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.reportProblems(JDTBasedSpoonCompiler.java:564)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:120)
at spoon.support.compiler.jdt.JDTBasedSpoonCompiler.build(JDTBasedSpoonCompiler.java:101)
我找不到任何自动解决依赖关系的方法?如何为一般项目修复它们——不仅仅是这个特定的项目?