Eclipse settings generator

5 votes
Dependency:
compile ":eclipse-scripts:1.0.7"

 Documentation  Source

Summary

Creates .classpath and .project files for Eclipse/STS integration.Downloads the sources and javadocs for dependencies from public repositories.Links the sources and javadocs to the dependent libraries.example use (Eclipse / Groovy-Eclipse plugin, no STS): grails compilegrails download-sources-and-javadocs (run twice in a row)grails download-sources-and-javadocsgrails create-eclipse-filessh scripts/create_cpvardirs_unix.sh (unix) or scripts/create_cpvardirs_windows.bat (windows)then import eclipse_workspace_settings.epf Eclipse Preference to your Eclipse Workspaceexample use (STS Grails dependency manager compatible):grails integrate-with --eclipsegrails compilegrails download-sources-and-javadocs (run twice in a row)grails download-sources-and-javadocsgrails sts-link-sources-and-javadocs For more information:grails help download-sources-and-javadocsgrails help create-eclipse-filesgrails help sts-link-sources-and-javadocs

Installation

grails install-plugin eclipse-scripts 1.0.6

You can manually copy or symlink the scripts to GRAILS_HOME/scripts directory if you want global installation.
Global installation (--global) gives an error in Grails 1.2.1 .

Alternative installation of scripts in unix (not as a plugin):

cd $GRAILS_HOME/scripts

wget https://github.com/lhotari/grails-eclipse-scripts/raw/master/scripts/DownloadSourcesAndJavadocs.groovy wget https://github.com/lhotari/grails-eclipse-scripts/raw/master/scripts/StsLinkSourcesAndJavadocs.groovy

Description

Support for Grails 2.3 / Aether added:
cd $GRAILS_HOME/scripts
wget https://github.com/lhotari/grails-eclipse-scripts/raw/master/scripts/StsLinkSourcesAndJavadocs.groovy

usage:

grails integrate-with --eclipse
grails compile
grails refresh-dependencies --include-source --include-javadoc test.xml
grails sts-link-sources-and-javadocs

News: Support for STS/GGTS 3.0 is in Github's master branch. Download StsLinkSourcesAndJavadocs.groovy file and place it in GRAILS_HOME/scripts.
New in 1.0.6 version: Support for Grails 2.0.x
Grails 2.x allows downloading dependency sources without this plugin using the command
grails refresh-dependencies --include-source --include-javadoc test.xml
This command is currently broken. There is an open jira to fix this problem. http://jira.grails.org/browse/GRAILS-8955

Features

Creates .classpath and .project files for Eclipse integration. Downloads the sources and javadocs for dependencies from public repositories. Links the sources and javadocs to the dependent libraries (navigating/debugging source code is now possible, javadoc tooltips show up for most libraries).

The plugin removes user specific information from .classpath and .project files and makes it possible to shared these files in a large team of Grails developers. Eclipse classpath variables and linked resources (=path variables) are used for removing user specific parts. Eclipse project reference/dependency is added to inline-plugins (it's easier to develop a larger Grails project in Eclipse now). The script creates a Eclipse Preference File with proper values so that it can be imported in to Eclipse Workspace.

STS isn't required. The settings should be ok in plain Eclipse + Groovy Eclipse plugin.

Since 1.0.3 version, a script called "sts-link-sources-and-javadocs" has been added to support STS Grails Dependency Management. This script should be used to link downloaded sources and javadocs to "Grails Dependencies" classpath container in STS. (You have to download sources and javadocs before adding links with the script.)

Quick start (STS 2.5.2)

grails integrate-with --eclipse
grails compile
grails download-sources-and-javadocs
grails sts-link-sources-and-javadocs

After running the script refresh your workspace in STS and restart STS.

Quick start (plain Eclipse / Eclipse + Groovy-Eclipse plugin)

grails compile
grails download-sources-and-javadocs
grails create-eclipse-files

This step is required if there are several developers on your team and you want to share common .project/.classpath files. This will create a script for creating symbolic links / ntfs junctions. There is a limitation in Eclipse that you cannot use classpath or path variables in Javadoc URLs.

sh scripts/create_cpvardirs_unix.sh (unix) or scripts/create_cpvardirs_windows.bat (windows)
grails create-eclipse-files  (updates .classpath to use the symbolic links in javadoc urls)

then import eclipse_workspace_settings.epf Eclipse Preference to your Eclipse Workspace (File->Import->General->Preferences->select file->Finish).

For detailed usage

grails help download-sources-and-javadocs
grails help create-eclipse-files
grails help sts-link-sources-and-javadocs