Maven 1.x SCM Plugin
  1. Maven 1.x SCM Plugin
  2. MPSCM-63

If project.xml can't be edited (e.g. read only), prepare-release goal still succeeds

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.6.1
    • Labels:
      None
    • Number of attachments :
      0

      Description

      If the scm plugin can't edit the project.xml file, the prepare-release goal shows that the error happened (by showing a stack trace), but doesn't fail. It should fail with nothing changed in the source control repository.

        Issue Links

          Activity

          Hide
          Dennis Lundberg added a comment -

          What is the correct way to handle this. I have found the source of the Exception in maven-release-plugin, but I'm unsure how to handle it. Here is the calling sequence:

          maven-scm-plugin:
          plugin.jelly goal prepare:release

          maven-release-plugin:
          plugin.jelly taglib definition release:transform
          plugin.jelly tag definition release-version
          transformer = new VersionTransformerTag
          transformer.write()
          AbstractPomTransformer.write()

          The last method doesn't handle the fact that the output file might not be writable, so I added that check and throw an Exception with a suitable message. What kind of Exception should I throw so that it can be caught in the jelly script later on?

          How do you handle handle exceptions in jelly? Can someone point me to another plugin that might do that.

          Also how do you tell a target to fail?

          Show
          Dennis Lundberg added a comment - What is the correct way to handle this. I have found the source of the Exception in maven-release-plugin, but I'm unsure how to handle it. Here is the calling sequence: maven-scm-plugin: plugin.jelly goal prepare:release maven-release-plugin: plugin.jelly taglib definition release:transform plugin.jelly tag definition release-version transformer = new VersionTransformerTag transformer.write() AbstractPomTransformer.write() The last method doesn't handle the fact that the output file might not be writable, so I added that check and throw an Exception with a suitable message. What kind of Exception should I throw so that it can be caught in the jelly script later on? How do you handle handle exceptions in jelly? Can someone point me to another plugin that might do that. Also how do you tell a target to fail?
          Hide
          Lukas Theussl added a comment -

          You can use the jelly:catch tag (http://jakarta.apache.org/commons/jelly/tags.html). There are examples for its use in the jira, dashboard, xdoc plugins (at least). A target fails simply with the <ant:fail> task. Oh, and thanks for working on this!

          Show
          Lukas Theussl added a comment - You can use the jelly:catch tag ( http://jakarta.apache.org/commons/jelly/tags.html ). There are examples for its use in the jira, dashboard, xdoc plugins (at least). A target fails simply with the <ant:fail> task. Oh, and thanks for working on this!

            People

            • Assignee:
              Lukas Theussl
              Reporter:
              David Jackman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: