0

I have a simple maven parent project containing

<modules>
  <module>myGrailsPlugin<module>
  <module>someVanillaMavenProject<module>
</modules>

Folder structure is straightforward.

parent
|_ myGrailsPlugin
    |_ pom.xml
    |_ MyGrailsPlugin.groovy
|_ someVanillaMavenProject
    |_ pom.xml
|_ pom.xml

Both modules, can be build sucessfully, when built individually. However when I run

mvn compile

on the parent project I get the following error.

Embedded Error: java.lang.reflect.InvocationTargetException
MyGrailsPlugin.groovy (The system cannot find the file specified.)

The file myGrailsPlugin.groovy exist in the top level of the myGrailsPlugin folder and is the grails plugin descriptor. Seems maven does not look up the file in this folder.

Any idea how do fix this?


The pom.xml of the GrailsPlugin looks like that.

...
<build>
    ...
    <pluginManagement />
    <plugins>
        <plugin>
            <groupId>org.grails</groupId>
            <artifactId>grails-maven-plugin</artifactId>
            <version>${grails.version}</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <id>set-version</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <command>set-version</command>
                        <args>${project.version}</args>
                    </configuration>
                </execution>
                <execution>
                    <id>package-plugin</id>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <command>package-plugin</command>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        ...
    </plugins>
</build>
...

Regards, Will

Will
  • 2,858
  • 6
  • 33
  • 50
  • 1
    Can you show us what your `parent/myGrailsPlugin/pom.xml` looks like? I would like to see how you have defined the [`grails-maven-plugin`](http://grails.org/doc/latest/guide/commandLine.html#antAndMaven). – maba Nov 09 '12 at 07:55
  • I added the part of the pom.xml where the plugin is defined. I think it might be this bug: http://jira.grails.org/browse/MAVEN-157 – Will Nov 09 '12 at 08:30
  • Just removed the set-version execution, and it seems to work fine. But that would lead to a workaround, rather than a solution. – Will Nov 09 '12 at 08:42

1 Answers1

1

After a while I figured out this is a bug in the grails gwt plugin. The src/gwt folder will be looked up in the parent directory instead of the submodules directory. But this does not exist. So copying the complete folder to the parent will let the build complete sucessfully. I didn't like this workaround and decided to change my build configuration to build the modules separately.

Will
  • 2,858
  • 6
  • 33
  • 50