亲自己主动手从源代码 构建 Groovy 2.3.8 公布包
今天為了學習 怎樣使用 Groovy 寫 Groovy 的測試代碼, 所以到?http://groovy.codehaus.org/Download 下載了 Groovy 2.3.8 的源碼包.
Groovy 是採用 Gradle 作為 構建工具的. 先看我本地的 Gradle 的相關環境:
然后我在加壓縮之后的源代碼根文件夾下輸入 ?gradle tasks ?, ?
gradle 開始從 jcenter 下載須要的 jar 包,?
然后開始編譯,
最后出現這個錯誤:
Detected development environment Deployment environment set to BintrayFAILURE: Build failed with an exception.* Where: Script 'H:\TDDownload\groovy-src-2.3.8\groovy-2.3.8\gradle\pomconfigurer.gradle' line: 10* What went wrong: A problem occurred evaluating script. > Could not find property 'groovy' on configuration container.* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.BUILD FAILEDTotal time: 5 mins 7.403 secs我接著用 gradle tasks --info ?命令再跑一遍, 還是出現以下的錯誤:
Detected development environment Deployment environment set to BintrayFAILURE: Build failed with an exception.* Where: Script 'H:\TDDownload\groovy-src-2.3.8\groovy-2.3.8\gradle\pomconfigurer.gradle' line: 10* What went wrong: A problem occurred evaluating script. > Could not find property 'groovy' on configuration container.* Try: Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.BUILD FAILEDTotal time: 7.911 secs Stopped 0 compiler daemon(s). Received result DaemonCommandResult[type=CommandFailure, value=org.gradle.launcher.exec.ReportedException: org.gradle.internal.exceptions.LocationAwareException : Script 'H:\TDDownload\groovy-src-2.3.8\groovy-2.3.8\gradle\pomconfigurer.gradle' line: 10 A problem occurred evaluating script.] from daemon DaemonInfo{pid=7252, address=[65f71eaa-6377-4a8a-9370-d90fced0f265 port:50883, addresses:[/127.0.0.1, /0:0:0: 0:0:0:0:1]], idle=false, context=DefaultDaemonContext[uid=581b3403-93ac-4a93-bcd9-d5374bbb9a86,javaHome=H:\ProgramFiles\Java\jdk1.8.0_25,daemonRegistryDir=C:\Us ers\chenjo\.gradle\daemon,pid=7252,idleTimeout=120000,daemonOpts=-XX:MaxPermSize=196m,-XX:+CMSClassUnloadingEnabled,-XX:+CMSPermGenSweepingEnabled,-Xmx640m,-Dfi le.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]}.如何繞過這個錯誤呢? ?難道是我的 Gradle 的版本號問題?
于是我打開文件 ?H:\TDDownload\groovy-src-2.3.8\groovy-2.3.8\README.adoc ,
發現里面說到:
To build everything using Gradle (the command below will download Gradle automatically, you do not need to download it first)../gradlew clean dist于是我就打開 命令行 窗體 到 源代碼文件夾下, ?鍵入: ?gradlew clean dist
我發現這個命令會首先下載一個 gradle-1.12 -all 到本地
C:\Users\chenjo\.gradle\wrapper\dists\gradle-1.12-all
然后加壓縮, 然后在以該版本號下載 jar 包 以及進行 編譯, 匯總.... 盡管中間有一些警告, 或是下載 jar 包時網絡受阻, 我就中斷命令又一次運行幾次, 最后 build 成功.
Applying Javadoc fix tool (see http://www.kb.cert.org/vuls/id/225657) into H:\TDDownload\groovy-src-2.3.8\groovy-2.3.8\target\alljavadoc :doc :distDoc :distSrc :groovydoc :javadoc Applying Javadoc fix tool (see http://www.kb.cert.org/vuls/id/225657) into H:\TDDownload\groovy-src-2.3.8\groovy-2.3.8\target\docs\javadoc :syncDoc :distBUILD SUCCESSFULTotal time: 18 mins 2.66 secs然后我看到 生成的 target 目錄 竟然有 500 多 M 字節.
在 項目文件夾\target\distributions\ 下, 有例如以下生成的公布文件:
groovy-binary-2.3.8.zip
groovy-docs-2.3.8.zip
groovy-sdk-2.3.8.zip
groovy-src-2.3.8.zip
總結
以上是生活随笔為你收集整理的亲自己主动手从源代码 构建 Groovy 2.3.8 公布包的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 招聘│微软云计算英雄帖来了,快接招!
- 下一篇: pdb学习笔记