Sign in to edit and +1 items.
Login required
Download

Eclipse settings generator

(3)
Author(s) Lari Hotari
Current Release 1.0.6   (1 week ago)
Grails Version 1.2.0 > *
License(s) Apache License 2.0
Tags debugging  eclipse  ide  javadoc  sources  sts 
Dependency
compile ":eclipse-scripts:1.0.6"
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 compile grails download-sources-and-javadocs (run twice in a row) grails download-sources-and-javadocs grails create-eclipse-files sh scripts/create_cpvardirs_unix.sh (unix) or scripts/create_cpvardirs_windows.bat (windows) then import eclipse_workspace_settings.epf Eclipse Preference to your Eclipse Workspace

example use (STS Grails dependency manager compatible): grails integrate-with --eclipse grails compile grails download-sources-and-javadocs (run twice in a row) grails download-sources-and-javadocs grails sts-link-sources-and-javadocs

For more information: grails help download-sources-and-javadocs grails help create-eclipse-files grails help sts-link-sources-and-javadocs

Last updated by lhotari 1 week ago
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

Last updated by lhotari 3 days ago
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
Last updated by lhotari 1 year ago
Q: How do I link grails jars to sources in Grails 1.4.x?

A: For Grails 1.4.0-BUILD.SNAPSHOT, checkout sources from git to some directory and provide the directory as a parameter:

grails sts-link-sources-and-javadocs --grailsSource=/home/user/grails-core

In Grails 1.3.x , the sources should get linked to GRAILS_HOME/src/java directory by default.

Last updated by admin 2 years ago