Maven 2.x Changelog Plugin

Generated links to files in scm are based on the scm url tag in the pom (but should they be??)

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.0
  • Component/s: None
  • Labels:
    None
  • Environment:
    OSX 10.4.3, java 1.4.2_09
  • Number of attachments :
    1

Description

The problem is that the scm url element in the pom which is supposed to be a link to "The URL to the project's browsable CVS repository." is not necessarily the same link you might use to show a file in the repository.

I think this should be a configurable parameter instead.

As such, it is impossible for me to have both the Source Repository report generate a correct link and have the changelog generate a correct link. I have to choose one or the other.

Examples:

To browse repository:
http://apollo.ucalgary.ca/websvncommons/listing.php?repname=pmgt&rev=0&sc=0&path=/trunk/pmgt-jar

To see a file:
http://apollo.ucalgary.ca/websvncommons/filedetails.php?repname=pmgt&rev=0&sc=0&path=/trunk/pmgt-jar/src/main/java/ca/ucalgary/commons/pmgt/model/solution/Counter.java

The difference is the script used to generate the page. I have a patch which uses a configurable parameter if interested, but I'm not sure this is the best approach, given some work also needs to be done with regards to submodule report generation.

Issue Links

Activity

Hide
Julian Wood added a comment -

This patch does 3 things.

1. It adds a parameter called displayFileDetailUrl.

2. If this parameter is detected in the config for this plugin in the pom, then it will be used preferentially over the scm url provided in the pom to create links to files in your scm.

3. It adds a condition in generateLinks(String, String, String, Sink) to handle the case where your scm url starts with "scm:svn". While this works as well as the other conditions, I don't think any will work in a mutlimodule situation. The reason is that the scmUrl is suffixed with the artifactId of the module, while the names of the files are all prefixed by the artifactId of the module, so we end up repeating the artifactId twice in the path param of the url to the file in the scm. One of them needs to be removed, but I'm not sure how doing so would affect scm's other than svn.

Show
Julian Wood added a comment - This patch does 3 things. 1. It adds a parameter called displayFileDetailUrl. 2. If this parameter is detected in the config for this plugin in the pom, then it will be used preferentially over the scm url provided in the pom to create links to files in your scm. 3. It adds a condition in generateLinks(String, String, String, Sink) to handle the case where your scm url starts with "scm:svn". While this works as well as the other conditions, I don't think any will work in a mutlimodule situation. The reason is that the scmUrl is suffixed with the artifactId of the module, while the names of the files are all prefixed by the artifactId of the module, so we end up repeating the artifactId twice in the path param of the url to the file in the scm. One of them needs to be removed, but I'm not sure how doing so would affect scm's other than svn.
Hide
Julian Wood added a comment -

Unfortunately I posted my report in the wrong area, but there is a patch there which deals with the problem of using the same URL for the source repository report and for the generation of links in the changelog and file activity reports.

Show
Julian Wood added a comment - Unfortunately I posted my report in the wrong area, but there is a patch there which deals with the problem of using the same URL for the source repository report and for the generation of links in the changelog and file activity reports.
Hide
Julian Wood added a comment -

How can I edit this issue so that the component is changelog?

Show
Julian Wood added a comment - How can I edit this issue so that the component is changelog?
Hide
Edwin Punzalan added a comment -

Julian,

The patch you submitted may have been deprecated by recent svn commits. But don't worry, I'll add the parameter that you wanted.

Show
Edwin Punzalan added a comment - Julian, The patch you submitted may have been deprecated by recent svn commits. But don't worry, I'll add the parameter that you wanted.
Hide
Julian Wood added a comment -

Maybe it could be done like the link_template in the changes-maven-plugin:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>changes-maven-plugin</artifactId>
<reportSets>
<reportSet>
<configuration>
<link_template>%URL%/view.php?id=%ISSUE%</link_template>
</configuration>
<reports>
<report>changes-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>

Could have parameters for the path, etc.

Show
Julian Wood added a comment - Maybe it could be done like the link_template in the changes-maven-plugin: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>changes-maven-plugin</artifactId> <reportSets> <reportSet> <configuration> <link_template>%URL%/view.php?id=%ISSUE%</link_template> </configuration> <reports> <report>changes-report</report> </reports> </reportSet> </reportSets> </plugin> Could have parameters for the path, etc.
Hide
Edwin Punzalan added a comment -

Except that the scm URL does not only have the URL but also the path.

Show
Edwin Punzalan added a comment - Except that the scm URL does not only have the URL but also the path.
Hide
Edwin Punzalan added a comment -

Fixed in SVN.

Parameter name is displayFileDetailUrl which defaults to project.scm.url

Show
Edwin Punzalan added a comment - Fixed in SVN. Parameter name is displayFileDetailUrl which defaults to project.scm.url

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
1h
Time Spent - 1 hour