Wim Deblauwe a écrit :
ah, I haven't done that yet. I'm currently testing with a hardcoded value.
I managed to checkout to the working directory, but 2 problems:
1) ClearCase does not want to checkout to an already existing directory,
so in the checkout command, I first delete the directory to checkout to.
It is then re-created by ClearCase. This seems to work fine in my test,
so I think this is ok.
if it doesn't want to checkout to an alreasy existing directory, you can perhaps test the existence
of the directory and if it exists, run update command.
2) pom.xml is not in the root, so the build fails with:
Could not find the model file 'C:\Program Files\Apache Software
Foundation\continuum-1.0.1\bin\win32\..\..\apps\continuum\working-directory\32\pom.xml'
Why it isn't in root directory? can you checkout mymodule content in working
directory?
That is normal since it is in
"...working-directory\32\my_vob\modules\mymodule". ClearCase re-creates
the vob structure and everything in between up to where the module
actually is. What I have been thinking is creating a temperary snapshot
view and then copy everything from that temp location to
"working-directory\32". Problem is that I don't know where pom.xml is in
that structure, so I don't know how to that.
Other solution is that the user updates the build definition to point to
the location of the pom, but I tried that and it does not work.
Continuum does not seem to take that into account. Is that a known bug?
I think it isn't a good solution to checkout in a temp directory and copy all files in the correct
directory, because it will be slow to do the copy, and updaute will perhaps be less esay to do.
I prefer the second solution if you cant checkout mymodule in working directory. You're right, it's
a bug, please, file an issue and i'll fix it before 1.0.2 release.
Emmanuel
regards,
Wim
2005/12/1, Emmanuel Venisse <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>>:
I talk about file parsing in ${user.home}/.scm/
Wim Deblauwe a écrit :
>
>
> 2005/12/1, Emmanuel Venisse <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
> <mailto: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>>:
>
> Remove all maven-scm libs from
${continuum}/apps/continuum/lib and
> put in it all new maven-scm libs.
>
> What do you use for scm file parsing?
>
> Emmanuel
>
>
> Euh.. just stringtokenizer, like this:
>
> public class ClearCaseScmProviderRepository
> extends ScmProviderRepository
> {
> private String viewName;
> private File configSpec;
>
> /**
> *
> * @param url format is [view_name]:[url_to_configspec] or
> [view_name]|[url_to_configspec]
> */
> public ClearCaseScmProviderRepository( String url )
> throws ScmRepositoryException
> {
> try
> {
> System.out.println( "url = " + url );
> parseUrl( url );
> }
> catch ( MalformedURLException e )
> {
> throw new ScmRepositoryException( "Illegal URL: " + url +
> "(" + e.getMessage() + ")" );
> }
> catch ( URISyntaxException e )
> {
> throw new ScmRepositoryException( "Illegal URL: " + url +
> "(" + e.getMessage() + ")" );
> }
> catch ( UnknownHostException e )
> {
> throw new ScmRepositoryException( "Illegal URL: " + url +
> "(" + e.getMessage() + ")" );
> }
> }
>
> private void parseUrl( String url )
> throws MalformedURLException, URISyntaxException,
> UnknownHostException
> {
> if( url.indexOf( '|' ) != -1 )
> {
> StringTokenizer tokenizer = new StringTokenizer( url,
"|" );
> fillInProperties( tokenizer );
> }
> else
> {
> StringTokenizer tokenizer = new StringTokenizer( url,
":" );
> fillInProperties( tokenizer );
> }
> }
>
> private void fillInProperties( StringTokenizer tokenizer )
> throws UnknownHostException, URISyntaxException,
> MalformedURLException
> {
> if( tokenizer.countTokens() == 1 )
> {
> //No view name was given
> viewName = getDefaultViewName();
> String spec = tokenizer.nextToken();
> System.out.println( "spec = " + spec );
> configSpec = createConfigSpecFile( spec );
> }
> else
> {
> viewName = tokenizer.nextToken();
> System.out.println( "viewName = " + viewName );
> String pathname = tokenizer.nextToken();
> System.out.println( "pathname = " + pathname );
> configSpec = createConfigSpecFile( pathname );
> }
> }
>
> private File createConfigSpecFile( String spec )
> throws URISyntaxException, MalformedURLException
> {
> File result;
> if( spec.indexOf( ':' ) == -1 )
> {
> result = new File( spec );
> }
> else
> {
> result = new File( new URL( spec ).toURI() );
> }
> return result;
> }
>
> /**
> * Default: ${hostname}-{ user.name <http://user.name>
<http://user.name>}-${artifactId}
> * @return
> */
> private String getDefaultViewName()
> throws UnknownHostException
> {
> String username = System.getProperty( "user.name
<http://user.name>
> <http://user.name>", "nouser" );
> String hostname = getHostName();
> return username + "-" + hostname + "-maven";
> }
>
> private String getHostName()
> throws UnknownHostException
> {
> return InetAddress.getLocalHost().getHostName();
> }
>
> public String getViewName()
> {
> return viewName;
> }
>
> public File getConfigSpec()
> {
> return configSpec;
> }
> }
>