Blog

Working with Groovy and Grails: The Funnies!

1. Documentation

Have you ever wished that you could take Google with you on the road when you dont have access to the INTRANET? or at least the documentation for whatever programming language you are currently using?

Groovy provides you with the option to download the documentation:

or does it?

2. Installation

So lets try installing Groovy on a Mac OS X:

  • Download the source
  • cd into the directory and run `ant install
  • simple right? not until you get this lovely message:
youssef-chakers-macbook:groovy-1-1.7.0 youssefchaker$ ant installBuildfile: build.xmlTrying to override old definition of task javac-excludeLegacyAntVersion:-checkAntVersion:-banner:     [echo] Java Runtime Environment version: 1.5.0_22     [echo] Java Runtime Environment vendor: Apple Inc.     [echo] Ant version: Apache Ant version 1.7.1 compiled on June 27 2008     [echo] Operating system name: Mac OS X     [echo] Operating system architecture: i386     [echo] Operating system version: 10.5.8     [echo] Base directory: /opt/local/src/groovy-1-1.7.0     [echo] Java Home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home-initializeReports:    [mkdir] Created dir: /opt/local/src/groovy-1-1.7.0/target/reports-mavenTaskdef:-mavenPomDefinitions:     Processing /opt/local/src/groovy-1-1.7.0/pom.xml to /opt/local/src/groovy-1-1.7.0/target/groovy-all.pom     Loading stylesheet /opt/local/src/groovy-1-1.7.0/config/maven/groovy-all.xsl-mavenInit:-mavenFetchAllModules:[artifact:dependencies] Downloading: asm/asm/3.2/asm-3.2.pom from central[artifact:dependencies] Downloading: asm/asm/3.2/asm-3.2.pom from central[artifact:dependencies] Downloading: junit/junit/4.7/junit-4.7.pom from central[artifact:dependencies] Downloading: junit/junit/4.7/junit-4.7.pom from central[artifact:dependencies] Downloading: asm/asm-commons/3.2/asm-commons-3.2.pom from central[artifact:dependencies] Downloading: asm/asm-commons/3.2/asm-commons-3.2.pom from central[artifact:dependencies] Downloading: asm/asm-util/3.2/asm-util-3.2.pom from central[artifact:dependencies] Downloading: asm/asm-util/3.2/asm-util-3.2.pom from central[artifact:dependencies] Downloading: asm/asm-analysis/3.2/asm-analysis-3.2.pom from central[artifact:dependencies] Downloading: asm/asm-analysis/3.2/asm-analysis-3.2.pom from central[artifact:dependencies] Downloading: asm/asm-tree/3.2/asm-tree-3.2.pom from central[artifact:dependencies] Downloading: asm/asm-tree/3.2/asm-tree-3.2.pom from central[artifact:dependencies] Downloading: commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom from central[artifact:dependencies] Downloading: commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom from central[artifact:dependencies] Downloading: org/livetribe/livetribe-jsr223/2.0.6/livetribe-jsr223-2.0.6.pom from central[artifact:dependencies] Downloading: org/livetribe/livetribe-jsr223/2.0.6/livetribe-jsr223-2.0.6.pom from central[artifact:dependencies] Downloading: xmlunit/xmlunit/1.3/xmlunit-1.3.pom from central[artifact:dependencies] Downloading: xmlunit/xmlunit/1.3/xmlunit-1.3.pom from central[artifact:dependencies] Downloading: hsqldb/hsqldb/1.8.0.10/hsqldb-1.8.0.10.pom from central[artifact:dependencies] Downloading: hsqldb/hsqldb/1.8.0.10/hsqldb-1.8.0.10.pom from central[artifact:dependencies] Downloading: com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.pom from central[artifact:dependencies] Downloading: com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.pom from central[artifact:dependencies] Downloading: org/apache/ivy/ivy/2.1.0/ivy-2.1.0.pom from central[artifact:dependencies] Downloading: org/apache/ivy/ivy/2.1.0/ivy-2.1.0.pom from central[artifact:dependencies] Downloading: asm/asm/3.2/asm-3.2.jar from central[artifact:dependencies] Downloading: asm/asm/3.2/asm-3.2.jar from central[artifact:dependencies] Downloading: junit/junit/4.7/junit-4.7.jar from central[artifact:dependencies] Downloading: junit/junit/4.7/junit-4.7.jar from central[artifact:dependencies] Downloading: asm/asm-commons/3.2/asm-commons-3.2.jar from central[artifact:dependencies] Downloading: asm/asm-commons/3.2/asm-commons-3.2.jar from central[artifact:dependencies] Downloading: asm/asm-util/3.2/asm-util-3.2.jar from central[artifact:dependencies] Downloading: asm/asm-util/3.2/asm-util-3.2.jar from central[artifact:dependencies] Downloading: asm/asm-analysis/3.2/asm-analysis-3.2.jar from central[artifact:dependencies] Downloading: asm/asm-analysis/3.2/asm-analysis-3.2.jar from central[artifact:dependencies] Downloading: asm/asm-tree/3.2/asm-tree-3.2.jar from central[artifact:dependencies] Downloading: asm/asm-tree/3.2/asm-tree-3.2.jar from central[artifact:dependencies] Downloading: org/livetribe/livetribe-jsr223/2.0.6/livetribe-jsr223-2.0.6.jar from central[artifact:dependencies] Downloading: org/livetribe/livetribe-jsr223/2.0.6/livetribe-jsr223-2.0.6.jar from central[artifact:dependencies] Downloading: com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar from central[artifact:dependencies] Downloading: com/thoughtworks/xstream/xstream/1.3.1/xstream-1.3.1.jar from central[artifact:dependencies] Downloading: org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar from central[artifact:dependencies] Downloading: org/apache/ivy/ivy/2.1.0/ivy-2.1.0.jar from central[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.[artifact:dependencies]  Diagnosis:[artifact:dependencies][artifact:dependencies] Unable to resolve artifact: Missing:[artifact:dependencies] ----------[artifact:dependencies] 1) asm:asm:jar:3.2[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=asm -DartifactId=asm -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) asm:asm:jar:3.2[artifact:dependencies][artifact:dependencies] 2) junit:junit:jar:4.7[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=junit -DartifactId=junit -Dversion=4.7 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=junit -DartifactId=junit -Dversion=4.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) junit:junit:jar:4.7[artifact:dependencies][artifact:dependencies] 3) asm:asm-commons:jar:3.2[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=asm -DartifactId=asm-commons -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-commons -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) asm:asm-commons:jar:3.2[artifact:dependencies][artifact:dependencies] 4) asm:asm-util:jar:3.2[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=asm -DartifactId=asm-util -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-util -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) asm:asm-util:jar:3.2[artifact:dependencies][artifact:dependencies] 5) asm:asm-analysis:jar:3.2[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=asm -DartifactId=asm-analysis -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-analysis -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) asm:asm-analysis:jar:3.2[artifact:dependencies][artifact:dependencies] 6) asm:asm-tree:jar:3.2[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=asm -DartifactId=asm-tree -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-tree -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) asm:asm-tree:jar:3.2[artifact:dependencies][artifact:dependencies] 7) org.livetribe:livetribe-jsr223:jar:2.0.6[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=org.livetribe -DartifactId=livetribe-jsr223 -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=org.livetribe -DartifactId=livetribe-jsr223 -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) org.livetribe:livetribe-jsr223:jar:2.0.6[artifact:dependencies][artifact:dependencies] 8 ) com.thoughtworks.xstream:xstream:jar:1.3.1[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=com.thoughtworks.xstream -DartifactId=xstream -Dversion=1.3.1 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=com.thoughtworks.xstream -DartifactId=xstream -Dversion=1.3.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) com.thoughtworks.xstream:xstream:jar:1.3.1[artifact:dependencies][artifact:dependencies] 9) org.apache.ivy:ivy:jar:2.1.0[artifact:dependencies][artifact:dependencies]   Try downloading the file manually from the project website.[artifact:dependencies][artifact:dependencies]   Then, install it using the command:[artifact:dependencies]       mvn install:install-file -DgroupId=org.apache.ivy -DartifactId=ivy -Dversion=2.1.0 -Dpackaging=jar -Dfile=/path/to/file[artifact:dependencies][artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:[artifact:dependencies]       mvn deploy:deploy-file -DgroupId=org.apache.ivy -DartifactId=ivy -Dversion=2.1.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id][artifact:dependencies][artifact:dependencies]   Path to dependency:[artifact:dependencies]         1) org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies]         2) org.apache.ivy:ivy:jar:2.1.0[artifact:dependencies][artifact:dependencies] ----------[artifact:dependencies] 9 required artifacts are missing.[artifact:dependencies][artifact:dependencies] for artifact:[artifact:dependencies]   org.codehaus.groovy:groovy:jar:1.7.0[artifact:dependencies][artifact:dependencies] from the specified remote repositories:[artifact:dependencies]   central (http://repo1.maven.org/maven2)[artifact:dependencies][artifact:dependencies]BUILD FAILED/opt/local/src/groovy-1-1.7.0/config/ant/build-maven.xml:79: The following error occurred while executing this line:/opt/local/src/groovy-1-1.7.0/config/ant/build-maven.xml:52: The following error occurred while executing this line:/opt/local/src/groovy-1-1.7.0/config/ant/build-maven.xml:44: The following error occurred while executing this line:/opt/local/src/groovy-1-1.7.0/config/ant/build-maven.xml:29: Unable to resolve artifact: Missing:----------1) asm:asm:jar:3.2  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=asm -DartifactId=asm -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) asm:asm:jar:3.22) junit:junit:jar:4.7  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=junit -DartifactId=junit -Dversion=4.7 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=junit -DartifactId=junit -Dversion=4.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) junit:junit:jar:4.73) asm:asm-commons:jar:3.2  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=asm -DartifactId=asm-commons -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-commons -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) asm:asm-commons:jar:3.24) asm:asm-util:jar:3.2  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=asm -DartifactId=asm-util -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-util -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) asm:asm-util:jar:3.25) asm:asm-analysis:jar:3.2  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=asm -DartifactId=asm-analysis -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-analysis -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) asm:asm-analysis:jar:3.26) asm:asm-tree:jar:3.2  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=asm -DartifactId=asm-tree -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=asm -DartifactId=asm-tree -Dversion=3.2 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) asm:asm-tree:jar:3.27) org.livetribe:livetribe-jsr223:jar:2.0.6  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=org.livetribe -DartifactId=livetribe-jsr223 -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=org.livetribe -DartifactId=livetribe-jsr223 -Dversion=2.0.6 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) org.livetribe:livetribe-jsr223:jar:2.0.68 ) com.thoughtworks.xstream:xstream:jar:1.3.1  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=com.thoughtworks.xstream -DartifactId=xstream -Dversion=1.3.1 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=com.thoughtworks.xstream -DartifactId=xstream -Dversion=1.3.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) com.thoughtworks.xstream:xstream:jar:1.3.19) org.apache.ivy:ivy:jar:2.1.0  Try downloading the file manually from the project website.  Then, install it using the command:      mvn install:install-file -DgroupId=org.apache.ivy -DartifactId=ivy -Dversion=2.1.0 -Dpackaging=jar -Dfile=/path/to/file  Alternatively, if you host your own repository you can deploy the file there:      mvn deploy:deploy-file -DgroupId=org.apache.ivy -DartifactId=ivy -Dversion=2.1.0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]  Path to dependency:        1) org.codehaus.groovy:groovy:jar:1.7.0        2) org.apache.ivy:ivy:jar:2.1.0----------9 required artifacts are missing.for artifact:  org.codehaus.groovy:groovy:jar:1.7.0from the specified remote repositories:  central (http://repo1.maven.org/maven2)Total time: 18 seconds

Ok, how about we try MacPorts?

youssef-chakers-macbook:~ youssefchaker$ sudo port install groovyPassword:--->  Fetching apache-ant--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://www.ibiblio.org/pub/mirrors/apache/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.mirror.rafal.ca/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.adcserver.com.ar/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://www.mirrorservice.org/sites/ftp.apache.org/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.mirroring.de/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.multidist.com/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from ftp://ftp.infoscience.co.jp/pub/net/apache/dist/ant/binaries--->  Verifying checksum(s) for apache-ant--->  Extracting apache-ant--->  Configuring apache-ant--->  Building apache-ant--->  Staging apache-ant into destroot--->  Installing apache-ant @1.7.1_0--->  Activating apache-ant @1.7.1_0--->  Cleaning apache-ant--->  Fetching groovy--->  Attempting to fetch groovy-src-1.6.3.zip from http://distfiles.macports.org/groovy--->  Verifying checksum(s) for groovy--->  Extracting groovy--->  Configuring groovy--->  Building groovyError: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3" && ant install -DskipTests=true " returned error 1Command output: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3/config/ant/build-maven.xml:90: The following error occurred while executing this line:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3/config/ant/build-maven.xml:54: The following error occurred while executing this line:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3/config/ant/build-maven.xml:29: Unable to resolve artifact: Missing:----------1) biz.aQute:bnd:jar:0.0.258Try downloading the file manually from the project website.Then, install it using the command:mvn install:install-file -DgroupId=biz.aQute -DartifactId=bnd -Dversion=0.0.258 -Dpackaging=jar -Dfile=/path/to/fileAlternatively, if you host your own repository you can deploy the file there:mvn deploy:deploy-file -DgroupId=biz.aQute -DartifactId=bnd -Dversion=0.0.258 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]Path to dependency:1) groovy:groovy-tools:jar:internal2) biz.aQute:bnd:jar:0.0.258----------1 required artifact is missing.for artifact:groovy:groovy-tools:jar:internalfrom the specified remote repositories:central (http://repo1.maven.org/maven2),aQute (http://www.aQute.biz/repo)Total time: 2 minutes 51 secondsError: Status 1 encountered during processing.youssef-chakers-macbook:~ youssefchaker$ sudo port install groovyPassword:--->  Fetching apache-ant--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://www.ibiblio.org/pub/mirrors/apache/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.mirror.rafal.ca/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.adcserver.com.ar/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://www.mirrorservice.org/sites/ftp.apache.org/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.mirroring.de/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from http://apache.multidist.com/ant/binaries--->  Attempting to fetch apache-ant-1.7.1-bin.tar.bz2 from ftp://ftp.infoscience.co.jp/pub/net/apache/dist/ant/binaries--->  Verifying checksum(s) for apache-ant--->  Extracting apache-ant--->  Configuring apache-ant--->  Building apache-ant--->  Staging apache-ant into destroot--->  Installing apache-ant @1.7.1_0--->  Activating apache-ant @1.7.1_0--->  Cleaning apache-ant--->  Fetching groovy--->  Attempting to fetch groovy-src-1.6.3.zip from http://distfiles.macports.org/groovy--->  Verifying checksum(s) for groovy--->  Extracting groovy--->  Configuring groovy--->  Building groovyError: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3" && ant install -DskipTests=true " returned error 1Command output: /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3/config/ant/build-maven.xml:90: The following error occurred while executing this line:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3/config/ant/build-maven.xml:54: The following error occurred while executing this line:/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_java_groovy/work/groovy-1.6.3/config/ant/build-maven.xml:29: Unable to resolve artifact: Missing:----------1) biz.aQute:bnd:jar:0.0.258Try downloading the file manually from the project website.Then, install it using the command:mvn install:install-file -DgroupId=biz.aQute -DartifactId=bnd -Dversion=0.0.258 -Dpackaging=jar -Dfile=/path/to/fileAlternatively, if you host your own repository you can deploy the file there:mvn deploy:deploy-file -DgroupId=biz.aQute -DartifactId=bnd -Dversion=0.0.258 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]Path to dependency:1) groovy:groovy-tools:jar:internal2) biz.aQute:bnd:jar:0.0.258----------1 required artifact is missing.for artifact:groovy:groovy-tools:jar:internalfrom the specified remote repositories:central (http://repo1.maven.org/maven2),aQute (http://www.aQute.biz/repo)Total time: 2 minutes 51 secondsError: Status 1 encountered during processing.

meh!

sudo apt-get install groovy

to the rescue : D

3. Compiling!

I attended a presentation by Andy Hunt, he was talking about some of the stuff that he wrote in his book “Pragmatic Thinking & Leaning”, which is very good by the way, and he mentioned context switching a few times. Naturally, that came up in often afterwards, specially on twitter and I brushed it off mostly. I did some context switching but only when taking breaks and I didnt think it was a big deal. Not until I saw this line:

“[groovyc] Compiling 1 source file …”

and it hit me. Most people are tempted to do some context switching when they are dealing with time wasting tasks such as compiling! I had completely forgotten how it felt like. I was so immersed in the Ruby/Python/PHP world that I totally erased the memories of “Its compiling…” from my brain!!!

But in all seriousness, if you like Java but also appreciate what a language like Ruby provides and what a framework like Ruby on Rails adds to the table, Groovy and Grails are worth a shot. And if you want a quick overview and introduction to both, check out my friend, Mohamed Seifeddines thesis:

This document is written as my Masters thesis and is based on a long individual learning period of Groovy and Grails through the developement of what later became SoukLubnan.com. A Website in its younger days that allows people in Lebanon to Buy & Sell products online.

and heres the link: Introduction to Groovy and Grails