无法解析 Grails 3 中渲染插件的依赖关系
Could not resolve dependency for renderiing plugin in Grails 3
我在 build.gradle 中为我的 grails 3 项目添加了渲染插件作为依赖项,如 https://grails.org/plugin/rendering
中所述
compile ":rendering:1.0.0"
当我执行'gradle dependencies'时,提示失败。它没有给我任何错误消息,但是在列出依赖项时它说失败。
这些是随项目生成的默认存储库
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
我什至尝试过这种方法,但没有用
compile "rendering:rendering:1.0.0"
如果我遗漏了什么或语法有误,请告诉我。
rendering
插件的版本 1.0.0 与 Grails 3 不兼容。兼容版本为 2.0.0-SNAPSHOT
及更高版本。
compile "org.grails.plugins:rendering:2.0.0-SNAPSHOT"
在 build.gradle
should be good with the repository that is currently present.
对于 Grails 2.*,是的,您需要使用此存储库:http://repo.grails.org/grails/plugins/org/grails/plugins/rendering/1.0.0/。
maven { url "https://repo.grails.org/grails/plugins" }
我们可以解决依赖注入问题。我们正在处理的项目 on.So 出现了一些问题,创建了一个新项目并且它运行良好。谢谢。
但是我们在渲染方面仍然存在问题 method.We 正在调用如下渲染方法来生成 pdf。 'pdf' 模板位于 atviews/render/_pdf.gsp
ByteArrayOutputStream baos = new ByteArrayOutputStream();
pdfRenderingService.render([template: '/render/pdf', model: [form:"Hello text"]],baos)
它抛出以下异常。如果我们以错误的方式调用 render 方法,谁能告诉我们。
Line | Method
->> 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 617 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
Caused by NullPointerException: null
->> 1337 | getPublicDeclaredMethods in java.beans.Introspector
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1197 | getTargetMethodInfo in ''
| 426 | getBeanInfo in ''
| 173 | getBeanInfo in ''
| 31 | init . . in grails.plugins.rendering.document.RenderEnvironment
| 68 | with in ''
| 60 | with . . in ''
| 65 | generateXhtml in grails.plugins.rendering.document.XhtmlDocumentService
| 35 | createDocument in ''
| 36 | render in grails.plugins.rendering.RenderingService
| 43 | buildPdf in RenderController.groovy
我在 build.gradle 中为我的 grails 3 项目添加了渲染插件作为依赖项,如 https://grails.org/plugin/rendering
中所述compile ":rendering:1.0.0"
当我执行'gradle dependencies'时,提示失败。它没有给我任何错误消息,但是在列出依赖项时它说失败。
这些是随项目生成的默认存储库
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
我什至尝试过这种方法,但没有用
compile "rendering:rendering:1.0.0"
如果我遗漏了什么或语法有误,请告诉我。
rendering
插件的版本 1.0.0 与 Grails 3 不兼容。兼容版本为 2.0.0-SNAPSHOT
及更高版本。
compile "org.grails.plugins:rendering:2.0.0-SNAPSHOT"
在 build.gradle
should be good with the repository that is currently present.
对于 Grails 2.*,是的,您需要使用此存储库:http://repo.grails.org/grails/plugins/org/grails/plugins/rendering/1.0.0/。
maven { url "https://repo.grails.org/grails/plugins" }
我们可以解决依赖注入问题。我们正在处理的项目 on.So 出现了一些问题,创建了一个新项目并且它运行良好。谢谢。
但是我们在渲染方面仍然存在问题 method.We 正在调用如下渲染方法来生成 pdf。 'pdf' 模板位于 atviews/render/_pdf.gsp
ByteArrayOutputStream baos = new ByteArrayOutputStream();
pdfRenderingService.render([template: '/render/pdf', model: [form:"Hello text"]],baos)
它抛出以下异常。如果我们以错误的方式调用 render 方法,谁能告诉我们。
Line | Method
->> 1142 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 617 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
Caused by NullPointerException: null
->> 1337 | getPublicDeclaredMethods in java.beans.Introspector
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1197 | getTargetMethodInfo in ''
| 426 | getBeanInfo in ''
| 173 | getBeanInfo in ''
| 31 | init . . in grails.plugins.rendering.document.RenderEnvironment
| 68 | with in ''
| 60 | with . . in ''
| 65 | generateXhtml in grails.plugins.rendering.document.XhtmlDocumentService
| 35 | createDocument in ''
| 36 | render in grails.plugins.rendering.RenderingService
| 43 | buildPdf in RenderController.groovy