Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h2>Prerequisites</h2><h3>Java Developer Kit (JDK)</h3><p>You will need a <a href="http://java.sun.com/j2se/1.5">JDK 1.5+ (J2SE 1.5+)</a> or compatible JDK to build Groovy.</p><h3>Apache Ant</h3><p>To execute the build process you need to have <a href="http://ant.apache.org">Apache Ant</a> version <code>1.7.0</code> (or newer) installed.</p><table class="wysiwyg-macro" data-macro-name="note" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>The optional TraX taskdefs are required, and some linux distributions, such as openSUSE, may require you to install them separately from the ant packages.</p></td></tr></table><h3>Git Client</h3><p>To fetch the source code for the server, you will need to have a <a href="http://git-scm.com/">Git</a> client version 1.2 (or newer, 1.4 is recommended) installed.</p><table class="wysiwyg-macro" data-macro-name="note" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>If you are using a source archive from the <a href="http://dist.groovy.codehaus.org/distributions/">distribution site</a> site, then you do not need to have a Git client installed.</p></td></tr></table><h2>Fetch the Groovy Source Code</h2><h3>From Git</h3><p>Have a look at our <a class="confluence-link" href="/display/GROOVY/Git" data-linked-resource-id="227050718" data-linked-resource-type="page" data-linked-resource-default-alias="Git" data-base-url="http://docs.codehaus.org">Git page</a> for further details on how to get the sources, either from the Codehaus Git repository, or the GitHub mirror.</p><h3>From a Source Archive</h3><p>Select one of the <code>*-src.*</code> archives from the <a href="http://dist.groovy.codehaus.org/distributions/">distribution site</a> site and unzip it.</p><p>For example, to use the source from the Groovy <code>2.0.0-beta-2</code> release:</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>wget http://dist.groovy.codehaus.org/distributions/groovy-src-2.0.0-beta-2.zip unzip groovy-src-2.0.0-beta-2.zip </pre></td></tr></table><h2>Preparing to Build for the First Time</h2><p>If you are behind a proxy firewall, you may need to set up proxy information in a <code>~/.ant/settings.xml</code> or <code>~/.m2/settings.xml</code> file:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><?xml version="1.0"?> <settings> <proxies> <proxy> <protocol>http</protocol> <host>proxy.host.net</host> <port>8080</port> <nonProxyHosts>localhost</nonProxyHosts> </proxy> </proxies> </settings> </pre></td></tr></table><p>If you will need to publish artifacts then you will need to have appropriate permissions with codehaus and ensure that you have stored your credentials in a <code>~/.ant/settings.xml</code> or <code>~/.m2/settings.xml</code> file of the form:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre><?xml version="1.0"?> <settings> <servers> <server> <id>codehaus.org</id> <username>YOUR_USER_NAME</username> <password>YOUR_PASSWORD</password> </server> </servers> </settings> </pre></td></tr></table><h2>Building</h2><p>To build everything, run tests and create a complete installation in <code>target/install</code>, run:</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>ant install </pre></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" data-macro-parameters="title=Useful Information" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm86dGl0bGU9VXNlZnVsIEluZm9ybWF0aW9ufQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>In case of java.lang.OutOfMemoryError try increasing the size of the heap space by setting the ANT_OPTS variable as follows:</p><p>ANT_OPTS=-Xmx512M</p><p>Increase the size of the heap size if required.</p></td></tr></table><table class="wysiwyg-macro" data-macro-name="info" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm99&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>If the unit tests hang indefinitely while building, try adding the following to your ant command:</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>-Djava.awt.headless=true</pre></td></tr></table></td></tr></table><p>After this finished successfully, then you can try out the distribution that was just built. For example to play with <code>groovysh</code> you can run:</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>./target/install/bin/groovysh </pre></td></tr></table><p>Sometimes its desirable to skip the test execution for faster turn around. To turn off tests set the <code>skipTests</code> property, as in:</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>ant install -DskipTests=true </pre></td></tr></table><h2>Distribution Archives</h2><p>To build a Groovy distribution archive:</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>ant dist </pre></td></tr></table><p>This will build everything, generate documentation and create distribution archives under <code>target/dist</code>:</p><table class="wysiwyg-macro" data-macro-name="section" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3NlY3Rpb259&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><table class="wysiwyg-macro" data-macro-name="column" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvbHVtbn0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><ul><li><code>groovy-binary-</code><code><em>VERSION</em></code><code>.zip</code></li><li><code>groovy-docs-</code><code><em>VERSION</em></code><code>.zip</code></li><li><code>groovy-src-</code><code><em>VERSION</em></code><code>.zip</code></li></ul></td></tr></table><table class="wysiwyg-macro" data-macro-name="column" data-macro-parameters="width=60%" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvbHVtbjp3aWR0aD02MCV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><table class="wysiwyg-macro" data-macro-name="note" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>As you might have guessed <em>VERSION</em> will be the version of the project you are building, like <code>2.0.0-beta-2-SNAPSHOT</code> for pre-releases or <code>2.0.0-beta-2</code> for a released version.</p></td></tr></table></td></tr></table></td></tr></table><h2>Publishing Artifacts</h2><p>To publish artifacts to the Maven 2 repository, run:</p><table class="wysiwyg-macro" data-macro-name="noformat" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vZm9ybWF0fQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>ant deploy </pre></td></tr></table><p>This will either publish to the <a href="http://repository.codehaus.org/org/codehaus/groovy">release repository</a> or the <a href="http://snapshots.repository.codehaus.org/org/codehaus/groovy">snapshot repository</a> based on whether the POM version contains <code>SNAPSHOT</code> or not.</p><p>If deploy is failing, then check <a href="http://hausmates.codehaus.org/WebDAV">Installing the UserTrust CA into the Java JDK</a>.</p><h2>Building from IntelliJ IDEA</h2><p>Please follow the instructions <a class="confluence-link" href="/display/GROOVY/Setting+up+IntelliJ+IDEA+to+build+Groovy" data-linked-resource-id="227051427" data-linked-resource-type="page" data-linked-resource-default-alias="Setting up IntelliJ IDEA to build Groovy" data-base-url="http://docs.codehaus.org">found here</a>.</p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced