精通Groovy 3:基于Java的动态脚本编程(第二版)

5星 · 超过95%的资源 需积分: 10 28 下载量 168 浏览量 更新于2024-07-17 收藏 2.24MB PDF 举报
"Learning Groovy 3: Java-Based Dynamic Scripting 2nd Edition" 是一本由 Adam L. Davis 撰写的英文书籍,专注于教授如何利用Groovy语言的动态脚本能力来构建强大的应用程序,特别关注Groovy 3.0的新特性。这本书涵盖了Groovy的基础知识,如安装Groovy、使用Groovy工具以及Groovy开发工具包(GDK)的运用。此外,还深入讲解了Groovy的高级主题,包括Groovy设计模式、用Groovy编写领域特定语言(DSL)以及利用Groovy的函数式编程特性。 Groovy 3.0引入了Parrot解析器,支持更多的语法选项和语言特性,书中对此进行了更新。此外,还涵盖了Groovydoc的使用,允许你在代码中嵌入文档注释。本书也介绍了Groovy对Java类型注解的支持等内容。 除了核心语言,书里还讨论了Groovy的生态系统扩展,包括Groovy的构建系统Gradle、Web应用框架Grails、测试框架Spock以及反应式Web库Ratpack的使用方法。 通过阅读本书,读者将: 1. 掌握Groovy基础,包括GDK的使用。 2. 精通高级Groovy,学会编写Groovy DSL。 3. 学习Groovy中的函数式编程。 4. 使用内置并发库GPars进行多线程处理。 5. 应用Gradle进行项目构建。 6. 熟练掌握Grails框架构建Web应用。 7. 运用Spock进行测试驱动开发。 8. 利用Ratpack创建反应式Web应用。 这本书面向有Java背景的读者,但任何具备基本编程技能的人都可以从中学到知识。它提供了一次充实且易于理解的Groovy语言和生态系统的探索之旅。 本书内容详细,适合想要深入了解Groovy并将其应用于实际项目开发的开发者阅读,无论你是想提高现有Java项目的效率,还是希望进入Groovy的世界,都能从中受益。通过学习本书,你可以充分利用Groovy的灵活性和强大功能,提升你的编程技巧和项目生产力。

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 14: Invalid parameter "failFast", did you mean "unit"? @ line 14, column 50. eout(time: 48, unit: 'HOURS', failFast: ^ WorkflowScript: 16: Invalid step "parallel" used - not allowed in this context - The parallel step can only be used as the only top-level step in a stages step block @ line 16, column 6. parallel { ^ WorkflowScript: 18: Invalid step "stage" used - not allowed in this context - The stage step cannot be used in Declarative Pipelines @ line 18, column 7. stage('version-A35-2290000204') { ^ 3 errors at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:309) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1107) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:323) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:293) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.GroovySandbox$Scope.parse(GroovySandbox.java:163) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:190) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:175) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:568) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:518) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:336) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Finished: FAILURE

2023-07-13 上传

Running in Durability level: MAX_SURVIVABILITY [2023-06-02 14:07:25] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: [2023-06-02 14:07:25] WorkflowScript: 26: No steps specified for branch @ line 26, column 13. [2023-06-02 14:07:25] steps { [2023-06-02 14:07:25] ^ [2023-06-02 14:07:25] [2023-06-02 14:07:25] 1 error [2023-06-02 14:07:25] [2023-06-02 14:07:25] at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) [2023-06-02 14:07:25] at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085) [2023-06-02 14:07:25] at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603) [2023-06-02 14:07:25] at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581) [2023-06-02 14:07:25] at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) [2023-06-02 14:07:25] at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) [2023-06-02 14:07:25] at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) [2023-06-02 14:07:25] at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) [2023-06-02 14:07:25] at groovy.lang.GroovyShell.parse(GroovyShell.java:700) [2023-06-02 14:07:25] at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142) [2023-06-02 14:07:25] at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127) [2023-06-02 14:07:25] at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:571) [2023-06-02 14:07:25] at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:523) [2023-06-02 14:07:25] at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:327) [2023-06-02 14:07:25] at hudson.model.ResourceController.execute(ResourceController.java:100) [2023-06-02 14:07:25] at hudson.model.Executor.run(Executor.java:433) [2023-06-02 14:07:25] Finished: FAILURE

2023-06-03 上传