今天为了学习 如何使用 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
于是我就打开 命令行 窗口 到 源码目录下, 键入: @H_403_55@ gradlew clean dist
我发现这个命令会首先下载一个 gradle-1.12 -all 到本地
@H_403_55@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
总结以上是内存溢出为你收集整理的亲自动手从源码 构建 Groovy 2.3.8 发布包全部内容,希望文章能够帮你解决亲自动手从源码 构建 Groovy 2.3.8 发布包所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)