親自動手從源碼 構建 Groovy 2.3.8 發布包,groovy2.3.8

來源:互聯網
上載者:User

親自動手從源碼 構建 Groovy 2.3.8 發布包,groovy2.3.8


今天為了學習 如何使用 Groovy 寫 Groovy 的測試代碼, 所以到 http://groovy.codehaus.org/Download 下載了 Groovy 2.3.8 的原始碼包.

Groovy 是採用 Gradle 作為 構建工具的. 先看我本地的 Gradle 的相關環境:


>gradle -v------------------------------------------------------------Gradle 2.2------------------------------------------------------------Build time: 2014-11-10 13:31:44 UTCBuild number: noneRevision: aab8521f1fd9a3484cac18123a72bcfdeb7006ecGroovy: 2.3.6Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013JVM: 1.8.0_25 (Oracle Corporation 25.25-b02)OS: Windows 7 6.1 amd64

然後我在加壓縮之後的源碼根目錄下輸入  gradle tasks  ,  

gradle 開始從 jcenter 下載需要的 jar 包, 

然後開始編譯,

最後出現這個錯誤:

Detected development environmentDeployment 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 environmentDeployment 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 secsStopped 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: 10A 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:\Users\chenjo\.gradle\daemon,pid=7252,idleTimeout=120000,daemonOpts=-XX:MaxPermSize=196m,-XX:+CMSClassUnloadingEnabled,-XX:+CMSPermGenSweepingEnabled,-Xmx640m,-Dfile.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:javadocApplying 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


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.