You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Chris White <ch...@gmail.com> on 2017/01/17 23:14:54 UTC

Configure grape.config for groovy-eclipse-plugin

Is there a way to configure the groovy.config system property for the
groovy-eclipse-compiler such that you can pass the location of a specific
grapeConfig.xml file for the build (for example on a build server), rather
than it being pulled from the default ~/.groovy/grapeConfig.xml location.

I've tried the following, but that errors without any further information:

[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[DEBUG] Compiling 207 source files to /home/user/workspace/my-
project/target/classes
[DEBUG] incrementalBuildHelper#afterRebuildExecution
[INFO] Found 0 errors and 0 warnings.
[INFO] ------------------------------------------------------------
------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------
------------
...
[ERROR] Failed to execute goal org.apache.maven.plugins:
maven-compiler-plugin:3.6.0:compile (default-compile) on project
my-project: Compilation failure -> [Help 1]

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.0</version>
        <extensions>true</extensions>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <compilerId>groovy-eclipse-compiler</compilerId>
            <compilerArgs>
                <arg>-Dgrape.config=/path/to/grapeConfig.xml</arg>
            </compilerArgs>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-eclipse-compiler</artifactId>
                <version>2.9.2-01</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-eclipse-batch</artifactId>
                <version>2.4.3-01</version>
            </dependency>
            <!-- to allow @Grab annotations -->
            <dependency>
                <groupId>org.apache.ivy</groupId>
                <artifactId>ivy</artifactId>
                <version>2.4.0</version>
            </dependency>
        </dependencies>
    </plugin>

Removing that compilerArg gives the following error (which is expected as i
need to configure where to pull the grapes from):

[ERROR] @Grab(group="org.jsoup", module="jsoup", version="1.8.2",
type="jar"),
[ERROR] ^^^
[ERROR] Groovy:Ambiguous method overloading for method
org.apache.ivy.core.settings.IvySettings#load.

Thanks