Continuum
  1. Continuum
  2. CONTINUUM-2222

pom.xml is deleted if validation fails

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.3, 1.3.4 (Beta)
    • Fix Version/s: 1.4.2
    • Component/s: Integration - Maven 2
    • Environment:
      Java 1.6.0_10, RedHat Enterprise Linux 5.3, Maven 2.1.0, Perforce 2008.2
    • Complexity:
      Intermediate
    • Number of attachments :
      0

      Description

      If Continuum fails to parse the project descriptor for some reason, the pom.xml is deleted from the workspace. With SCMs like Perforce that keep track of the files in a workspace, the pom.xml is not re-synced on subsequent checkouts, which causes build errors until someone manually intervenes (either by making an unnecessary change to the file or by forcing a sync of the workspace).

      Here's a sample trace. It was caused when a dependency's version was refactored to the dependencyManagement section of the parent. Continuum built the lower-level project before the parent.

      org.apache.maven.continuum.execution.ContinuumBuildExecutorException: Unable to read the Maven project descriptor '/var/continuum/sources/484/pom.xml': Failed to validate POM for project com.example:invalid-project at /var/continuum/sources/484/pom.xml
      'dependencies.dependency.version' is missing for com.example:other-project

      at org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor.getMavenProject(MavenTwoBuildExecutor.java:334)
      at org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor.shouldBuild(MavenTwoBuildExecutor.java:414)
      at org.apache.maven.continuum.buildcontroller.DefaultBuildController.shouldBuild(DefaultBuildController.java:557)
      at org.apache.maven.continuum.buildcontroller.DefaultBuildController.build(DefaultBuildController.java:151)
      at org.apache.maven.continuum.buildcontroller.BuildProjectTaskExecutor.executeTask(BuildProjectTaskExecutor.java:50)
      at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116)
      at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
      at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:178)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
      at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
      at java.lang.Thread.run(Thread.java:619)

        Activity

        Hide
        Wendy Smoak added a comment - - edited

        I've seen this too, and just confirmed that it is still a problem with Continuum 1.3.4.

        If something causes the pom to be invalid (such as a missing dependency version) then the pom.xml is deleted from the working copy, and the build result output says

        [INFO] Scanning for projects...
        [INFO] ------------------------------------------------------------------------
        [INFO] Building Maven Default Project
        [INFO]    task-segment: [clean, install]
        [INFO] ------------------------------------------------------------------------
        [INFO] ------------------------------------------------------------------------
        [ERROR] BUILD ERROR
        [INFO] ------------------------------------------------------------------------
        [INFO] Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
        [INFO] ------------------------------------------------------------------------
        [INFO] For more information, run Maven with the -e switch
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: < 1 second
        [INFO] Finished at: Fri Sep 04 13:09:51 MST 2009
        [INFO] Final Memory: 3M/80M
        [INFO] ------------------------------------------------------------------------
        
        Show
        Wendy Smoak added a comment - - edited I've seen this too, and just confirmed that it is still a problem with Continuum 1.3.4. If something causes the pom to be invalid (such as a missing dependency version) then the pom.xml is deleted from the working copy, and the build result output says [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [clean, install] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one. [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: < 1 second [INFO] Finished at: Fri Sep 04 13:09:51 MST 2009 [INFO] Final Memory: 3M/80M [INFO] ------------------------------------------------------------------------
        Hide
        Maxime Robert added a comment -

        Still not resolved in version 1.4.1.

        In the DefaultMavenBuilderHelper class, the following lines seems to (sometimes) delete the pom.xml:

        As explained in the original description of this issue, the fact that the pom.xml is deleted while it is versioned (in svn) causes some problems...

        Show
        Maxime Robert added a comment - Still not resolved in version 1.4.1. In the DefaultMavenBuilderHelper class, the following lines seems to (sometimes) delete the pom.xml: #444: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?view=markup#l444 #457: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?view=markup#l457 As explained in the original description of this issue, the fact that the pom.xml is deleted while it is versioned (in svn) causes some problems...
        Hide
        Brett Porter added a comment -

        Thanks for the pointers Maxime. Would you be willing to put together some tests and a patch to fix those?

        Show
        Brett Porter added a comment - Thanks for the pointers Maxime. Would you be willing to put together some tests and a patch to fix those?
        Hide
        Brett Porter added a comment -

        Fix applied.

        Show
        Brett Porter added a comment - Fix applied.

          People

          • Assignee:
            Brett Porter
            Reporter:
            Peter Janes
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: