I have a multi-module project and can’t perform a release.
I tried these layouts:
svnroot/trunk/parent
/module1
/module2
and
svnroot/parent/trunk
svnroot/module1/trunk
svnroot/module2/trunk
After reading
- http://ericmiles.wordpress.com/tag/flat-structure/ and
- http://ericmiles.wordpress.com/tag/release-plugin/
I hoped that the 1st layout would work, but in both cases maven terminates with this error:
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: unknown
Reason: Could not find the model file 'C:\myworkspace\parent\target\module1'. for project unknown
[INFO] ------------------------------------------------------------------------
It seems that some work is already done when this error occurs, all version numbers are updated in the poms.
I recgonized that the parent module was checkout under parent\target\checkout and it seems that the plugin expects the modules checked out under target.
-
Did I miss an important setting ?
-
Could anyone describe how he got the mvn release to work?
The parent.pom has the following settings
<groupId>company.project</groupId>
<artifactId>parent</artifactId>
<version>1.0.9-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>../module1</module>
<module>../module2</module>
</modules>
<scm>
<connection>scm:svn:file:///SVNROOT/trunk/parent</connection>
<url>file:///SVNROOT/trunk/parent</url>
</scm>
<dependency>
<groupId>company.project</groupId>
<artifactId>module1</artifactId>
<version>1.0.9-SNAPSHOT</version>
</dependency>
A modules pom looks like this
<parent>
<artifactId>parent</artifactId>
<groupId>company.project</groupId>
<version>1.0.9-SNAPSHOT</version>
</parent>
<name>module1</name>
<artifactId>module1</artifactId>
<scm>
<connection>scm:svn:file:///SVNROOT/trunk/module1</connection>
<url>file:///SVNROOT/trunk/module1</url>
</scm>
The release is invoked by
mvn -e -DcommitByProject=true -DautoVersionSubmodules=true -Dresume=false release:prepare release:perform
Maven version is 2.2.1
My structure is
etc. and I haven’t had any trouble with building or using the release plugin. I’m currently on 3.0.3, but I think it worked on 2.2.x. In any case, it doesn’t match either of the structures you list in your question and might be worth a try.