我正在为我的项目制作一个可运行的 jar,当它开始生成基准报告时,我不断收到此错误:
Exception in thread "main" java.lang.IllegalStateException: The websiteResource (twitterbootstrap/css/bootstrap-responsive.css) does not exist.
at org.optaplanner.benchmark.impl.report.WebsiteResourceUtils.copyResource(WebsiteR esourceUtils.java:57)
at org.optaplanner.benchmark.impl.report.WebsiteResourceUtils.copyResourcesTo(WebsiteResourceUtils.java:33)
at org.optaplanner.benchmark.impl.report.BenchmarkReport.writeHtmlOverviewFile(BenchmarkReport.java:738)
at org.optaplanner.benchmark.impl.report.BenchmarkReport.writeReport(BenchmarkReport.java:287)
at org.optaplanner.benchmark.impl.DefaultPlannerBenchmark.benchmarkingEnded(DefaultPlannerBenchmark.java:315)
at org.optaplanner.benchmark.impl.DefaultPlannerBenchmark.benchmark(DefaultPlannerBenchmark.java:109)
自从我在 drools 和 benchmarkConfig 路径前面添加了 "resources/"
后,其他一切都工作正常。
由于还有一些仅用于基准测试的资源,我可能也需要为它们做同样的事情。
我如何才能访问基准测试资源?
最佳答案
听起来您正在使用 IDE (Eclipse/IntelliJ/NetBeans/...) 从源代码进行构建,并且您的项目未正确设置为将 *.css
文件复制为类路径资源(因此它在某处对 css 有特定的排除)。
使用现代 IntelliJ IDEA 版本,打开 pom.xml
文件,这绝对不会发生。对于现代 Eclipse/NetBeans 版本,我认为也是如此。
关于java - Optaplanner - 网站资源不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40049576/