History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SCM-139
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dennis Lundberg
Reporter: Dennis Lundberg
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven SCM

Create a utility class for scm url checking/parsing

Created: 22/Jan/06 06:27 AM   Updated: 29/Oct/06 02:44 PM
Component/s: maven-scm-api
Affects Version/s: None
Fix Version/s: 1.0-beta-4

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive SCM-139-2.zip (5 kb)
2. Zip Archive SCM-139.zip (97 kb)
3. Java Source File ScmUrlUtils.java (3 kb)


Complexity: Intermediate


 Description  « Hide
There is a lot of code in different places, both in maven-scm and elsewhere, that checks and parses scm url:s. I propose that a utility class ScmUrlUtils be crated in maven-scm-api where such code (static methods) can be placed. The code there should not be scm provider specific. This should be accompanied by a test suite.

This concept might also be applied to individual scm providers, e.g. there could be a CvsScmUrlUtils in maven-scm-provider-cvs.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Dennis Lundberg - 22/Jan/06 07:29 AM
Attaching a draft of what the API might look like. The implementation is not done yet, this is just a requst for comments. Please have a look at it and tell me what you like/dislike and if there are other useful methods that can be put in there.

Emmanuel Venisse - 22/Jan/06 07:56 AM
  • isValid(): I'd prefer an other name like isValidGeneralFormat
  • remove "void validate( scmUrl )
  • getSeparator() : I prefer a String as returned value

Dennis Lundberg - 21/Feb/06 03:12 PM
Here is the implementation. There are unit tests as well, but I'm not sure how much coverage is needed. Please review and comment.

Dennis Lundberg - 21/Feb/06 03:18 PM
I'm sorry, the first zip file contained some extra payload.
Please use SCM-139-2.zip instead.

Emmanuel Venisse - 22/Feb/06 05:23 PM
It will be good if you can provide a patch that remove all duplicated code

Dennis Lundberg - 23/Feb/06 01:28 PM
Do you mean duplicated code in the new files that I created or in the files that are already a part of maven-scm?

Emmanuel Venisse - 24/Feb/06 02:02 AM
i thought to a patch that remove "lot of code in different place" and use your class instead.

Dennis Lundberg - 25/Feb/06 06:23 AM
I'll pull something together then.

I assume that this will be put in after 1.0 has been released, so I will create the patch against 1.0 final. Will that be OK?


Emmanuel Venisse - 25/Feb/06 06:52 AM
yes

Emmanuel Venisse - 17/Oct/06 06:36 AM
Dennis, can you do it before the 1.0 release? I don't think this patch will break api compatibility

Dennis Lundberg - 24/Oct/06 01:19 PM
I hope to have some time this weekend.
Have you set a date for 1.0 yet?

Dennis Lundberg - 29/Oct/06 02:44 PM
After adding a couple of more tests, I committed the new utility class.

I also searched for similar code in other classes and replaced it with calls to methods in the new utility class.