jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Release Plugin
  • MRELEASE-131

release:prepare failed in 'cvs ... commit' phase for multi-module build

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major 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

Bug - A problem which impairs or prevents the functions of the product. MRELEASE-94 Modified Parent POM is not commited

  • Blocker - Blocks development and/or testing work, production could not run
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Chris Byrd added a comment - 31/Aug/06 3:53 PM

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...
[INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com:/cvsrepo
-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:/cvsrepo -q tag -F -c pw_linesheets_0_1
[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!

Show
Chris Byrd added a comment - 31/Aug/06 3:53 PM 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... [INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com:/cvsrepo -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:/cvsrepo -q tag -F -c pw_linesheets_0_1 [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!
Hide
Permalink
Chris Byrd added a comment - 31/Aug/06 4:16 PM

In additional testing, I have found that the the release:prepare goal is actually failing on the commit somehow. What is occurring is that of the 3 poms I have in my project, the release:prepare goal is committing the 2 child poms, but not the parent pom. Then when it goes to tag the code, the parent pom has not been committed, and it errors out.

Therefore, the issue is to determine why the parent pom is not getting committed, and what I need to do to make this happen.

Show
Chris Byrd added a comment - 31/Aug/06 4:16 PM In additional testing, I have found that the the release:prepare goal is actually failing on the commit somehow. What is occurring is that of the 3 poms I have in my project, the release:prepare goal is committing the 2 child poms, but not the parent pom. Then when it goes to tag the code, the parent pom has not been committed, and it errors out. Therefore, the issue is to determine why the parent pom is not getting committed, and what I need to do to make this happen.
Hide
Permalink
Chris Byrd added a comment - 31/Aug/06 4:27 PM

Here is the logs with the debug stacktrace. The interesting thing is that the code is not even attempting to commit the top level parent pom. All mvn tasks are executed from the top level directory. It is committing both the children poms, and skipping over the parent pom. All other plugins and goals have worked correctly. I can only guess this is somehow a bug with the release plugin.

[INFO] Checking in modified POMs...
[INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com:/cvsrepo -q commit -R -F D:\DOCUME~1\xfxc104\LOCALS~1\Temp\scm-commit-message6743.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
[DEBUG] Checking in pw-linesheets-core/pom.xml;
[DEBUG] D:/cvsrepo/pw_linesheets/pw-linesheets-core/pom.xml,v <-- pom.xml
[DEBUG] new revision: 1.10; previous revision: 1.9
[DEBUG] done
[DEBUG] Checking in pw-linesheets-webapp/pom.xml;
[DEBUG] D:/cvsrepo/pw_linesheets/pw-linesheets-webapp/pom.xml,v <-- pom.xml
[DEBUG] new revision: 1.9; previous revision: 1.8
[DEBUG] done
[INFO] Tagging release with the label pw_linesheets_1_0...
[INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com:/cvsrepo -q tag -F -c pw_linesheets_1_0
[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!

Show
Chris Byrd added a comment - 31/Aug/06 4:27 PM Here is the logs with the debug stacktrace. The interesting thing is that the code is not even attempting to commit the top level parent pom. All mvn tasks are executed from the top level directory. It is committing both the children poms, and skipping over the parent pom. All other plugins and goals have worked correctly. I can only guess this is somehow a bug with the release plugin. [INFO] Checking in modified POMs... [INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com:/cvsrepo -q commit -R -F D:\DOCUME~1\xfxc104\LOCALS~1\Temp\scm-commit-message6743.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 [DEBUG] Checking in pw-linesheets-core/pom.xml; [DEBUG] D:/cvsrepo/pw_linesheets/pw-linesheets-core/pom.xml,v <-- pom.xml [DEBUG] new revision: 1.10; previous revision: 1.9 [DEBUG] done [DEBUG] Checking in pw-linesheets-webapp/pom.xml; [DEBUG] D:/cvsrepo/pw_linesheets/pw-linesheets-webapp/pom.xml,v <-- pom.xml [DEBUG] new revision: 1.9; previous revision: 1.8 [DEBUG] done [INFO] Tagging release with the label pw_linesheets_1_0... [INFO] Executing: cvs -z3 -f -d :pserver:xfxc104@ad807645.eh.pweh.com:/cvsrepo -q tag -F -c pw_linesheets_1_0 [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!
Hide
Permalink
Chris Byrd added a comment - 31/Aug/06 5:27 PM

Looks like the problem is not with the release:prepare goal. The problem is with the cvs implementation. For some reason it doesn't checkin the top level file specified, when recursing through sub-directories.

Show
Chris Byrd added a comment - 31/Aug/06 5:27 PM Looks like the problem is not with the release:prepare goal. The problem is with the cvs implementation. For some reason it doesn't checkin the top level file specified, when recursing through sub-directories.
Hide
Permalink
Peter De Velder added a comment - 08/Mar/07 8:53 AM

Same problem, tested this out in cvs (1.11.1p1),

1) Problem reproduced when using option: -d MYCVSROOT,
2) No more problem without option: -d MYCVSROOT

~/maven_parent> cvs -nq update -d
M pom.xml
M child1/pom.xml
M child2/pom.xml

#---------------------------------------------------------------------------

  1. Problem: parent pom.xml is not committed, together with the child poms
    #---------------------------------------------------------------------------
    ~/maven_parent> cvs -d :pserver:myuser@mycvsserver:/home/cvs/play commit -m "test" pom.xml child1/pom.xml child2/pom.xml
    Checking in admin_focus/pom.xml; /home/cvs/play/maven_parent/child1/pom.xml,v <-- pom.xml
    new revision: 1.81; previous revision: 1.80
    done
    Checking in focus_core/pom.xml;
    /home/cvs/play/maven_parent/child1/pom.xml,v <-- pom.xml
    new revision: 1.74; previous revision: 1.73
    done

#---------------------------------------------------------------------------

  1. Problem fixed: No longer using -d option
    #---------------------------------------------------------------------------
    ~/maven_parent> cvs commit -m "test" pom.xml child1/pom.xml child2/pom.xml
    Checking in pom.xml;
    /home/cvs/play/maven_parent/pom.xml,v <-- pom.xml
    new revision: 1.30; previous revision: 1.29
    done
    Checking in admin_focus/pom.xml;
    /home/cvs/play/maven_parent/child1/pom.xml,v <-- pom.xml
    new revision: 1.82; previous revision: 1.81
    done
    Checking in focus_core/pom.xml;
    /home/cvs/play/maven_parent/child2/pom.xml,v <-- pom.xml
    new revision: 1.75; previous revision: 1.74
    done
Show
Peter De Velder added a comment - 08/Mar/07 8:53 AM Same problem, tested this out in cvs (1.11.1p1), 1) Problem reproduced when using option: -d MYCVSROOT, 2) No more problem without option: -d MYCVSROOT ~/maven_parent> cvs -nq update -d M pom.xml M child1/pom.xml M child2/pom.xml #---------------------------------------------------------------------------
  1. Problem: parent pom.xml is not committed, together with the child poms #--------------------------------------------------------------------------- ~/maven_parent> cvs -d :pserver:myuser@mycvsserver:/home/cvs/play commit -m "test" pom.xml child1/pom.xml child2/pom.xml Checking in admin_focus/pom.xml; /home/cvs/play/maven_parent/child1/pom.xml,v <-- pom.xml new revision: 1.81; previous revision: 1.80 done Checking in focus_core/pom.xml; /home/cvs/play/maven_parent/child1/pom.xml,v <-- pom.xml new revision: 1.74; previous revision: 1.73 done
#---------------------------------------------------------------------------
  1. Problem fixed: No longer using -d option #--------------------------------------------------------------------------- ~/maven_parent> cvs commit -m "test" pom.xml child1/pom.xml child2/pom.xml Checking in pom.xml; /home/cvs/play/maven_parent/pom.xml,v <-- pom.xml new revision: 1.30; previous revision: 1.29 done Checking in admin_focus/pom.xml; /home/cvs/play/maven_parent/child1/pom.xml,v <-- pom.xml new revision: 1.82; previous revision: 1.81 done Checking in focus_core/pom.xml; /home/cvs/play/maven_parent/child2/pom.xml,v <-- pom.xml new revision: 1.75; previous revision: 1.74 done
Hide
Permalink
Emmanuel Venisse added a comment - 21/Mar/07 3:43 PM

Fixed in Maven-SCM

Show
Emmanuel Venisse added a comment - 21/Mar/07 3:43 PM Fixed in Maven-SCM

People

  • Assignee:
    Emmanuel Venisse
    Reporter:
    Hung Le
Vote (4)
Watch (4)

Dates

  • Created:
    12/Jun/06 5:57 PM
    Updated:
    21/Mar/07 3:43 PM
    Resolved:
    21/Mar/07 3:43 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.