Maven Changes Plugin
  1. Maven Changes Plugin
  2. MCHANGES-218

Downloading from JIRA fails if issueManagement.url has trailing slash

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Component/s: jira
    • Labels:
      None
    • Number of attachments :
      0

      Description

      With an issueManagement.url like http://jira.codehaus.org/browse/DOXIA/ (note trailing slash), the jira report chokes

      [WARNING] Downloading from JIRA failed. Received: [404]
      

      and an empty report is generated. removing the trailing slash makes it work.

        Activity

        Hide
        Dennis Lundberg added a comment -

        This is a known limitation that is somewhat documented in the "Linking to Your Issue Management System" section at http://maven.apache.org/plugins/maven-changes-plugin/usage.html
        The documentation is of course in the wrong place for your use case.

        I'll take a look and see if I can try to fix the parsing routine. If now at least the docs should be improved to highlight this better.

        Show
        Dennis Lundberg added a comment - This is a known limitation that is somewhat documented in the "Linking to Your Issue Management System" section at http://maven.apache.org/plugins/maven-changes-plugin/usage.html The documentation is of course in the wrong place for your use case. I'll take a look and see if I can try to fix the parsing routine. If now at least the docs should be improved to highlight this better.
        Hide
        Lukas Theussl added a comment -

        Hacked it out: r1055775

        Show
        Lukas Theussl added a comment - Hacked it out: r1055775
        Lukas Theussl made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Lukas Theussl [ lukas ]
        Fix Version/s 2.4 [ 16043 ]
        Resolution Fixed [ 1 ]
        Hide
        Cristian Lupu added a comment -

        This fix doesn't work for the case when url is set to a value like "http://jira.codehaus.org/"
        Because it will remove the last "/" and few lines below it tries to extract url again based on the last index for "/" and the url extracted in that case is "http:/"

        54 if ( url.endsWith( "/" ) )
        55

        { 56 // MCHANGES-218 57 url = url.substring( 0, url.lastIndexOf( '/' ) ); 58 }

        .....................
        72 String jiraUrl = url.substring( 0, url.lastIndexOf( '/' ) );

        Easy to test with a quick unit test and a different value for issueManagementUrl:
        Map<String, String> jiraUrlAndProjectId = getJiraUrlAndProjectId("http://jira.codehaus.org/");
        assertEquals("http://jira.codehaus.org", jiraUrlAndProjectId.get("url"));

        Show
        Cristian Lupu added a comment - This fix doesn't work for the case when url is set to a value like "http://jira.codehaus.org/" Because it will remove the last "/" and few lines below it tries to extract url again based on the last index for "/" and the url extracted in that case is "http:/" 54 if ( url.endsWith( "/" ) ) 55 { 56 // MCHANGES-218 57 url = url.substring( 0, url.lastIndexOf( '/' ) ); 58 } ..................... 72 String jiraUrl = url.substring( 0, url.lastIndexOf( '/' ) ); Easy to test with a quick unit test and a different value for issueManagementUrl: Map<String, String> jiraUrlAndProjectId = getJiraUrlAndProjectId("http://jira.codehaus.org/"); assertEquals("http://jira.codehaus.org", jiraUrlAndProjectId.get("url"));
        Hide
        Cristian Lupu added a comment -

        I would create a unit test to test this method, getJiraUrlAndProjectId from JiraHelper class before trying to fix it again. And run it with different values for issueManagementUrl:

        http://jira.codehaus.org/browse/DOXIA/
        http://jira.codehaus.org/
        http://jira.codehaus.org
        http://jira.codehaus.org/browse/DOXIA

        and then try to fix it

        Show
        Cristian Lupu added a comment - I would create a unit test to test this method, getJiraUrlAndProjectId from JiraHelper class before trying to fix it again. And run it with different values for issueManagementUrl: http://jira.codehaus.org/browse/DOXIA/ http://jira.codehaus.org/ http://jira.codehaus.org http://jira.codehaus.org/browse/DOXIA and then try to fix it

          People

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

            Dates

            • Created:
              Updated:
              Resolved: