Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-beta-4
-
Fix Version/s: 2.0-beta-5
-
Component/s: scm
-
Labels:None
-
Environment:redhat linux, cvs 1.11.17, maven 2.0.4
Description
I have a multi-module setup
parent-module
child-module-1
child-module-2
...
In CVS, they are peer, to establish the parent-child layout, manually first check out
. parent-module (which has only the pom.xml)
then 'cd to parent-module' and manually check out each of the child module (using 'cvs co -d outputDir module_name)
when I use 'release:prepare', Maven2 failed at the 'commit phase'. After playing with the 'cvs commit ...' it appears that changing the order the 'list of modified POM's' gives different results. One that allow an OK 'commit' involves ordering the list of the modified POM's so that the parent POM is first in the list.
It does look as if this is a cvs-specific issue but if we can do something to help as work-around, that will be great. I did quick experiment by modifying ScmCommitPhase.java. In method createPomFiles(reactorProjects), sort the list before returning and it did let me complete the release:prepare step:
// hle@comergent.com
System.out.println("preSorted, pomFiles=" + pomFiles);
boolean sortPomFiles = true;
if (sortPomFiles) {
Comparator comp = new Comparator() {
public int compare(Object o1, Object o2) {
File f1 = (File) o1;
File f2 = (File) o2;
String str1 = f1.getAbsolutePath();
String str2 = f2.getAbsolutePath();
int rv = (str1.length() - str2.length());
if (rv == 0) {
rv = f1.compareTo(f2);
}
return rv;
}
};
Collections.sort(pomFiles, comp);
}
System.out.println("postSorted, pomFiles=" + pomFiles);
Issue Links
- relates to
-
MRELEASE-94
Modified Parent POM is not commited
-
I have the same problem, and a similar setup. I am using a cvs repository, and have the following module layout.
-parent module
-----> child module 1
-----> child module 2
During the the release:prepare goal it modifies the poms fo the parent and children, to update version numbers. Then it attempts to check in all poms with updated values, before it tags the code. It seems to commit the poms, then fails on the tag stating that the "pom.xml has been modified".
Looking logs, it sticks all 3 changed poms in the same commit, in the order (parent, child 1, child 2). I have no idea which pom.xml file is actually causing the problem, or if it is all 3.
I have a separate project that only has one module, and the release:prepare goal works fine in this scenario. The pom is basically the same for the multiple module project, except for the module dependencies.
The goal release:prepare -DdryRun=true works without a hitch. Its just the actual tag into the cvs scm that fails. I'm really at a loss for how to fix this. I hope someone has an idea. Below is the actual error.
[INFO] Checking in modified POMs...
:/cvsrepo
:/cvsrepo -q tag -F -c pw_linesheets_0_1
[INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com
-q commit -R -F D:\DOCUME~1\xfxc104\LOCALS~1\Temp\scm-commit-message5345.txt pom.xml pw-linesheets-core/pom.xml pw-linesheets-webapp/pom.xml
[INFO] Working directory: D:\Documents and Settings\xfxc104\My Documents\Dev\workspace\pw-linesheets
[INFO] Tagging release with the label pw_linesheets_0_1...
[INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com
[INFO] Working directory: D:\Documents and Settings\xfxc104\My Documents\Dev\workspace\pw-linesheets
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to tag SCM
Provider message:
The cvs tag command failed.
Command output:
cvs server: pom.xml is locally modified
cvs [server aborted]: correct the above errors first!