Minor issue with Groovy Run/Debug configuration and Maven

We have groovy-all version 1.8.4 dependency configured in one of our Maven module POM files. When I tried to debug a script in that module IntelliJ threw a class not found error. A little digging revealed the Maven groovy-all dependency is an OSGI bundle and IntelliJ does not resolve the bundled dependencies when running or debugging a Groovy script from a Run/Debug configuration. The workaround was adding my local Groovy distribution as a global library then adding it to the module but that was less than ideal. Is there another way to deal with this issue when using Maven to manage the Groovy dependency? Thanks!

Grant

3 comments
Comment actions Permalink

Could you please file a YouTrack issue with a small sample project demonstrating the problem? Or at least a fragment of your pom.xml.
.

0
Comment actions Permalink

Here is my POM file minus our project specific dependencies. I'll also create an issue for it. I had to add my local Groovy SDK as a dependency for Run/Debug to function otherwise it missed all the dependencies defined in the Maven groovy-all jar file.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <name>VBMS Tools ${project.version}</name>

    <groupId>gov.va.vba.vbms</groupId>
    <artifactId>vbms-tools</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>1.8.4</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <fork>true</fork>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.gmaven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <executions>
                    <execution>
                        <configuration>
                            <providerSelection>1.7</providerSelection>
                            <sources></sources>
                        </configuration>
                        <goals>
                            <goal>generateStubs</goal>
                            <goal>compile</goal>
                            <goal>generateTestStubs</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>

                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                        <version>1.8.4</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
                <configuration>
                    <descriptors>
                        <descriptor>src/assemble/filenetAssembly.xml</descriptor>
                    </descriptors>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

0
Comment actions Permalink

Grant,

I cannot find any mention of osgi bundles in the attached pom.
Also, IDEA 11 supports 'bundle' debendeny type out of the box, so it sould not be a problem.

Have you tried your running your code with IDEA 11?

Thanks,
Anton Makeev

0

Please sign in to leave a comment.