Maven 1.x Changelog Plugin

Some valid scm urls are not allowed by this plugin

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.9
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    4

Description

The solution to MPCHANGELOG-72 introduced a new bug. It is no longer possible to use an scm url that uses "|" as the separator.

There is also a possible future problem in this plugin with regards to scm urls. Upcoming versions of maven-scm will allow an scm url to start with "scm|" as well as "scm:".

  1. ChangeLog2Test.java
    22/Jan/06 5:31 PM
    3 kB
    Dennis Lundberg
  2. ChangeLogTest.java
    20/Jan/06 2:08 PM
    4 kB
    Dennis Lundberg
  3. MPCHANGELOG-81.patch
    20/Jan/06 2:13 PM
    4 kB
    Dennis Lundberg
  4. MPCHANGELOG-81-2.patch
    22/Jan/06 5:45 PM
    7 kB
    Dennis Lundberg

Activity

Hide
Dennis Lundberg added a comment -

Unfortunately this testcase is not complete. The class ChangeLog that I am trying to test is really hard to test because of its private methods. I am trying to test the method createFactory() but cannot access it directly as it is private.

Anyway, put this test file into a fresh checkout and run it. This will throw exceptions, because I have not managed to set up a correct environment to run the complete doExecute method in.

You will see that there are warnings for two of the tree tests, claiming that there is something wrong with the scm connections. The upcoming patch will fix both of these warnings.

Show
Dennis Lundberg added a comment - Unfortunately this testcase is not complete. The class ChangeLog that I am trying to test is really hard to test because of its private methods. I am trying to test the method createFactory() but cannot access it directly as it is private. Anyway, put this test file into a fresh checkout and run it. This will throw exceptions, because I have not managed to set up a correct environment to run the complete doExecute method in. You will see that there are warnings for two of the tree tests, claiming that there is something wrong with the scm connections. The upcoming patch will fix both of these warnings.
Hide
Dennis Lundberg added a comment -

This patch fixes the issues higlighted by the previous testcase. After this patch has been applied there should no long be any warnings when the previous testcase is run.

Show
Dennis Lundberg added a comment - This patch fixes the issues higlighted by the previous testcase. After this patch has been applied there should no long be any warnings when the previous testcase is run.
Hide
Lukas Theussl added a comment -

Are you sure this is a valid connection string (from RepositoryTest.java):

scm:cvs|pserver|anoncvs@cvs.apache.org|/home/cvspublic|module

Shouldn't the separator be set to the character after the 'scm'?

Show
Lukas Theussl added a comment - Are you sure this is a valid connection string (from RepositoryTest.java): scm:cvs|pserver|anoncvs@cvs.apache.org|/home/cvspublic|module Shouldn't the separator be set to the character after the 'scm'?
Hide
Dennis Lundberg added a comment -

That is a valid question. At the moment it does not have to be the same.
I ran this set of commands:
mvn scm:validate -DconnectionUrl="scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:module"
mvn scm:validate -DconnectionUrl="scm:cvs|pserver|anoncvs@cvs.apache.org|/home/cvspublic|module"
mvn scm:validate -DconnectionUrl="scm|cvs|pserver|anoncvs@cvs.apache.org|/home/cvspublic|module"

Using maven-scm-alpha-2 (couldn't find alpha-1 anywhere) produced these results:
VALID
VALID
INVALID

Using maven-scm-beta-3-SNAPSHOT produced these results:
VALID
VALID
VALID

As you can see this is consistent with what is in RepositoryTest. In both versions a url starting with "scm:" can use "|" as separator.

The only difference is in the third case, which I indicated is something that is coming in the next version of maven-scm.

Show
Dennis Lundberg added a comment - That is a valid question. At the moment it does not have to be the same. I ran this set of commands: mvn scm:validate -DconnectionUrl="scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:module" mvn scm:validate -DconnectionUrl="scm:cvs|pserver|anoncvs@cvs.apache.org|/home/cvspublic|module" mvn scm:validate -DconnectionUrl="scm|cvs|pserver|anoncvs@cvs.apache.org|/home/cvspublic|module" Using maven-scm-alpha-2 (couldn't find alpha-1 anywhere) produced these results: VALID VALID INVALID Using maven-scm-beta-3-SNAPSHOT produced these results: VALID VALID VALID As you can see this is consistent with what is in RepositoryTest. In both versions a url starting with "scm:" can use "|" as separator. The only difference is in the third case, which I indicated is something that is coming in the next version of maven-scm.
Hide
Dennis Lundberg added a comment -

Updated version of the test case that illuminates the problem. This is not to be checked in since it throws exceptions. When you run it you will receive one warning. That warning will disappear when the updated version of the patch is applied.

Show
Dennis Lundberg added a comment - Updated version of the test case that illuminates the problem. This is not to be checked in since it throws exceptions. When you run it you will receive one warning. That warning will disappear when the updated version of the patch is applied.
Hide
Dennis Lundberg added a comment -

Updated version of the patch. This patch affects a more files than the previous one. I had to tweak a few tests to successfully run "maven test".

There is one part of the code in RepositoryUtils.splitSCMConnection() that is not very pretty, but it get's the job done. I've added a comment in the code to explain what is going on there.

Show
Dennis Lundberg added a comment - Updated version of the patch. This patch affects a more files than the previous one. I had to tweak a few tests to successfully run "maven test". There is one part of the code in RepositoryUtils.splitSCMConnection() that is not very pretty, but it get's the job done. I've added a comment in the code to explain what is going on there.
Hide
Lukas Theussl added a comment -

Patch applied. Thanks!
For the record: we agreed on the scm-dev list that the format for a valid scm url should be scm:<provider><delimiter><provider-parameters>, ie it has to start with 'scm:', but <delimiter> can be either ':' or '|'.

Show
Lukas Theussl added a comment - Patch applied. Thanks! For the record: we agreed on the scm-dev list that the format for a valid scm url should be scm:<provider><delimiter><provider-parameters>, ie it has to start with 'scm:', but <delimiter> can be either ':' or '|'.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: