我有一个 JAX-RS 项目,它在 gradle 中有码头插件。我想用 gretty 替换 jetty 插件,因为 gradle 4 和其他版本不支持 jetty。运行 gretty 插件时出现以下错误。
任务“:appRunWar”执行失败。
java.lang.Exception:com/sun/jersey/spi/inject/InjectableProvider
包含 jetty 插件的 build.gradle 代码
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'eclipse'
jettyRun {
httpPort = 8080
reload = 'automatic'
scanIntervalSeconds = 2
daemon = false
}
//other things....
用 gretty 替换 jetty 的 build.gradle 代码
apply plugin: 'java'
apply plugin: 'war'
apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'
apply plugin: 'eclipse'
gretty {
httpPort = 8080
//contextPath = '/'
servletContainer = 'jetty9'
httpEnabled = true
}
//other things...