Posts Tagged ‘web development’

Working with Groovy and Grails: The Funnies!

Posted Saturday, January 30th, 2010 by Youssef Chaker

1. Documentation

Have you ever wished that you could take Google with you on the road when you don’t 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 install
Buildfile: build.xml
Trying 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.2

2) 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.7

3) 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.2

4) 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.2

5) 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.2

6) 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.2

7) 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.6

8 ) 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.1

9) 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.0

from 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 groovy

Password:

--->  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 groovy

Error: 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 1

Command 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.258

Try 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/file

Alternatively, 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:internal

2) biz.aQute:bnd:jar:0.0.258

----------

1 required artifact is missing.

for artifact:

groovy:groovy-tools:jar:internal

from the specified remote repositories:

central (http://repo1.maven.org/maven2),

aQute (http://www.aQute.biz/repo)

Total time: 2 minutes 51 seconds

Error: 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 didn’t 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 “It’s 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 Seifeddine’s 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 here’s the link: Introduction to Groovy and Grails

Rails vs. Django: a Beginner’s Point of View

Posted Monday, August 4th, 2008 by Youssef Chaker

For an agile web developer two frameworks are available for quick and easy deployment of a new website: Ruby on Rails for the Ruby fans and Django for the Python fans. These two tools should provide the same functionality and as someone who’s been working on two projects for the last month, each using one the frameworks, I have had the experience of starting from scratch on both of them and trying to learn both in parallel (or at least one right after the other without acquiring more experience in one and becoming biased for one over the other). So what has this experience taught me?

Deployment
It is very easy to start an application using both Rails or Django:
rails myapp vs. django-admin.py startproject mysite
even though one is wordier than the other it is pretty simple to start the project with all the directories and files needed automatically generated.

Starting the Server
This task is as simple as the previous one:
ruby script/server vs. python manage.py runserver
in both cases there is a call to the language in use, then passing a command. In Rails’ case the command is an executable found in the “script” directory whereas in Django’s case the command is an argument passed to the Python manager.

Configuration
Both frameworks provide a place to configure the application. Rails provide an entire directory to configure the database setup and the Rails environment whereas Django provides a settings.py file where all the configurations can be present but also provides the option of having a config directory for multiple personalized configurations.

Updating the Database
Yet another simple task:
rake db:migrate vs. python manage.py syncdb
In this case we notice that with Rails the call is actually to “rake” whereas for Django it is still consistent with the previous format. But we’ll see that Rails is also consistent where “rake” is called for everything relating to the database.

Creating Models
Where some of the differences begin:
With Rails you create one application that can have multiple controllers, models and models and link to each other using ruby script/generate * (where the * differs depending on what needs to be generated).
Whereas in Django you create multiple applications which each has its own models and views using python manage.py startapp myapp

Documentation
It seems that Rails is more widely used which results in more available resources online for documentation and help. None the less, the Django documentation site is very extended and provides sufficient help.

The Dirt
In the case of Rails I started the project from scratch by first following with the example in the book Agile Web Development with Rails, Third Edition and then applying what I learned to the project I was working on. Whereas in the case of the Django project, I was put on it late in the development process and tried to learn the language and at the same time understand what was already done on the project. My experience with both has been limited and what I have found is that the Rails magic seems to be the difference maker for most people. The majority are not comfortable with that “unknown” but I have seen some magic done with other languages like Java, although it is not the same type but in either case there is something in the background that is doing some sort of work for the programmer. And I have become comfortable with such a setting and because I have seen a bit of how programming languages interpreters work I understand and appreciate the Rails magic.

Even though I was more productive using Rails than I was using Django, which may have influenced my opinion about them, I am still willing to give Django a chance. Both are great tools for developing web applications in an agile manner. My recommendation though, if I have to make one, will go for Ruby on Rails, just because I was more comfortable with it.