3

I have installed the Maven for Eclipse plugin from Sonatype.

(update site: http://m2eclipse.sonatype.org/update/)

I am creating a Maven project, and choosing to use the groovy-maven-archetype as my starting point.

However, halfway through, I am seeing:

04/03/09 12:52:28 GMT: [FATAL ERROR] 
org.codehaus.mojo.groovy.stubgen.GenerateStubsMojo#execute()
caused a linkage error (java.lang.NoSuchMethodError). Check the realms:

... snip ...

Realm ID: plexus.core

org.codehaus.plexus.PlexusContainer.createChildContainer
(Ljava/lang/String;Ljava/util/List;Ljava/util/Map;)
Lorg/codehaus/plexus/PlexusContainer;

How can I fix this?

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
toolkit
  • 49,809
  • 17
  • 109
  • 135
  • Not sure if this helps, but you can use gmaven-archetype-basic v1.0-rc-5 with eclipse 3.4. That correctly creates groovy maven project for eclipse. – Kartik Shah Jun 05 '09 at 21:41

3 Answers3

2

At a command prompt, enter this: mvn archetype:generate Then, choose 40 (gmaven-archetype-basic) Then, follow the prompts. Once you have a maven project, you can enable Eclipse support by saying: mvn eclipse:eclipse

You can read Building Groovy Projects for more information.

AWhitford
  • 3,708
  • 3
  • 28
  • 38
0

Seems like a versioning problem to me. Are you sure you used all the right versions of the jars?

Suraj Chandran
  • 24,433
  • 12
  • 63
  • 94
  • Yeah, looks like an installation problem for me too. Try to reinstall m2eclipse. If that doesn't help, you get possibly better help at the m2eclipse users mailing list: http://m2eclipse.sonatype.org/project-information.html – Kutzi Nov 01 '09 at 12:21
0

Getting Groovy-Eclipse, gmaven, and Eclipse all working together seems to be pretty tricky at the present. Once you've got a project created with mvn archetype:generate, as AWhitford mentions, this site will show you a few of the tweaks you'll need to make it work.

GMaven's stub creation for Java files interferes with Groovy-Eclipse, hence the section on that page about commenting out stub creation. However, I went with the method mentioned in the comments for the relevant bug (GMAVEN-61) and created multiple executions for the gmaven plugin, like so:

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.groovy.maven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <version>1.0-rc-3</version>
        <!-- http://jira.codehaus.org/browse/GMAVEN-61 -->
        <executions>
          <execution>
            <id>default-cli</id>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
          <execution>
            <id>stubsonly</id>
            <goals>
              <goal>generateStubs</goal>
              <goal>generateTestStubs</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

I'm still not certain myself that this is clean for both pure Maven usage as well as within Eclipse, but it at least got me to the point where I stopped spending hours trying to get anything to work and got me coding on my actual project.

The Groovy-Eclipse and GMaven documentation are good reading for background info.

Lyle
  • 3,724
  • 3
  • 25
  • 25