You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jörg Hohwiller (JIRA)" <ji...@codehaus.org> on 2010/11/24 22:59:03 UTC

[jira] Created: (SCM-585) "repository cannot be null" on ScmManager.makeProviderScmRepository(String, File)

"repository cannot be null" on ScmManager.makeProviderScmRepository(String, File)
---------------------------------------------------------------------------------

                 Key: SCM-585
                 URL: http://jira.codehaus.org/browse/SCM-585
             Project: Maven SCM
          Issue Type: Bug
    Affects Versions: 1.4
            Reporter: Jörg Hohwiller


I want to update a subversion with maven-scm.
Therefore I get the ScmManager via Plexus and then do this:

ScmManager.makeProviderScmRepository("svn", new File(path/to/checkout));

What I get is:

java.lang.NullPointerException: repository cannot be null
	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:49)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.executeCommand(AbstractSvnScmProvider.java:356)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.info(AbstractSvnScmProvider.java:377)
	at org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider.getRepositoryURL(SvnExeScmProvider.java:150)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.makeProviderScmRepository(AbstractSvnScmProvider.java:119)
	at org.apache.maven.scm.manager.AbstractScmManager.makeProviderScmRepository(AbstractScmManager.java:267)

>From what I understand the code tries to execute "svn info" to get the repository URL.
However executing a command always checks that the repository is not null.
In this case the svn command should be executed in order to be able to create the repository.
It is not possible to create the repository before, because the URL is not known.

My suggestion is to revisit this block in AbstractCommand:
        if ( repository == null )
        {
            throw new NullPointerException( "repository cannot be null" );
        }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] (SCM-585) "repository cannot be null" on ScmManager.makeProviderScmRepository(String, File)

Posted by "Robert Scholte (JIRA)" <ji...@codehaus.org>.
     [ https://jira.codehaus.org/browse/SCM-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Scholte updated SCM-585:
-------------------------------

    Component/s: maven-scm-api
    Description: 
I want to update a subversion with maven-scm.
Therefore I get the ScmManager via Plexus and then do this:

{code}
ScmManager.makeProviderScmRepository("svn", new File(path/to/checkout));
{code}

What I get is:
{noformat}
java.lang.NullPointerException: repository cannot be null
	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:49)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.executeCommand(AbstractSvnScmProvider.java:356)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.info(AbstractSvnScmProvider.java:377)
	at org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider.getRepositoryURL(SvnExeScmProvider.java:150)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.makeProviderScmRepository(AbstractSvnScmProvider.java:119)
	at org.apache.maven.scm.manager.AbstractScmManager.makeProviderScmRepository(AbstractScmManager.java:267)
{noformat}

>From what I understand the code tries to execute "svn info" to get the repository URL.
However executing a command always checks that the repository is not {{null}}.
In this case the svn command should be executed in order to be able to create the repository.
It is not possible to create the repository before, because the URL is not known.

My suggestion is to revisit this block in AbstractCommand:
{code}
        if ( repository == null )
        {
            throw new NullPointerException( "repository cannot be null" );
        }
{code}

  was:
I want to update a subversion with maven-scm.
Therefore I get the ScmManager via Plexus and then do this:

ScmManager.makeProviderScmRepository("svn", new File(path/to/checkout));

What I get is:

java.lang.NullPointerException: repository cannot be null
	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:49)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.executeCommand(AbstractSvnScmProvider.java:356)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.info(AbstractSvnScmProvider.java:377)
	at org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider.getRepositoryURL(SvnExeScmProvider.java:150)
	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.makeProviderScmRepository(AbstractSvnScmProvider.java:119)
	at org.apache.maven.scm.manager.AbstractScmManager.makeProviderScmRepository(AbstractScmManager.java:267)

>From what I understand the code tries to execute "svn info" to get the repository URL.
However executing a command always checks that the repository is not null.
In this case the svn command should be executed in order to be able to create the repository.
It is not possible to create the repository before, because the URL is not known.

My suggestion is to revisit this block in AbstractCommand:
        if ( repository == null )
        {
            throw new NullPointerException( "repository cannot be null" );
        }


    
> "repository cannot be null" on ScmManager.makeProviderScmRepository(String, File)
> ---------------------------------------------------------------------------------
>
>                 Key: SCM-585
>                 URL: https://jira.codehaus.org/browse/SCM-585
>             Project: Maven SCM
>          Issue Type: Bug
>          Components: maven-scm-api
>    Affects Versions: 1.4
>            Reporter: Jörg Hohwiller
>
> I want to update a subversion with maven-scm.
> Therefore I get the ScmManager via Plexus and then do this:
> {code}
> ScmManager.makeProviderScmRepository("svn", new File(path/to/checkout));
> {code}
> What I get is:
> {noformat}
> java.lang.NullPointerException: repository cannot be null
> 	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:49)
> 	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.executeCommand(AbstractSvnScmProvider.java:356)
> 	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.info(AbstractSvnScmProvider.java:377)
> 	at org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider.getRepositoryURL(SvnExeScmProvider.java:150)
> 	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.makeProviderScmRepository(AbstractSvnScmProvider.java:119)
> 	at org.apache.maven.scm.manager.AbstractScmManager.makeProviderScmRepository(AbstractScmManager.java:267)
> {noformat}
> From what I understand the code tries to execute "svn info" to get the repository URL.
> However executing a command always checks that the repository is not {{null}}.
> In this case the svn command should be executed in order to be able to create the repository.
> It is not possible to create the repository before, because the URL is not known.
> My suggestion is to revisit this block in AbstractCommand:
> {code}
>         if ( repository == null )
>         {
>             throw new NullPointerException( "repository cannot be null" );
>         }
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

[jira] Commented: (SCM-585) "repository cannot be null" on ScmManager.makeProviderScmRepository(String, File)

Posted by "Jörg Hohwiller (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SCM-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=246640#action_246640 ] 

Jörg Hohwiller commented on SCM-585:
------------------------------------

I tried to workaround like this:

if ("svn".equals(vcsType)) {
        // workaround for SCM-585
        AbstractSvnScmProvider vcsProvider = (AbstractSvnScmProvider) this.scmManager
            .getProviderByType("svn");
        ScmProviderRepository dummyRepository = vcsProvider.makeProviderScmRepository(
            "http://dummy.org/scv/tunk", '/');
        SvnInfoScmResult infoResult = vcsProvider.info(dummyRepository, new ScmFileSet(
            new File(""), locationDirectory), null);
        String url = ((SvnInfoItem) infoResult.getInfoItems().get(0)).getURL();
        ScmProviderRepository vcsProviderRepository = vcsProvider.makeProviderScmRepository(url,
            '/');
        vcsRepository = new ScmRepository(vcsType, vcsProviderRepository);
      }

This does not help as then the info command is
cmd.exe /X /C "svn --non-interactive info http://dummy.org/scv/tunk/src/test/resources"

So there seems more buggy than just the assertion-if statement.

> "repository cannot be null" on ScmManager.makeProviderScmRepository(String, File)
> ---------------------------------------------------------------------------------
>
>                 Key: SCM-585
>                 URL: http://jira.codehaus.org/browse/SCM-585
>             Project: Maven SCM
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Jörg Hohwiller
>
> I want to update a subversion with maven-scm.
> Therefore I get the ScmManager via Plexus and then do this:
> ScmManager.makeProviderScmRepository("svn", new File(path/to/checkout));
> What I get is:
> java.lang.NullPointerException: repository cannot be null
> 	at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:49)
> 	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.executeCommand(AbstractSvnScmProvider.java:356)
> 	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.info(AbstractSvnScmProvider.java:377)
> 	at org.apache.maven.scm.provider.svn.svnexe.SvnExeScmProvider.getRepositoryURL(SvnExeScmProvider.java:150)
> 	at org.apache.maven.scm.provider.svn.AbstractSvnScmProvider.makeProviderScmRepository(AbstractSvnScmProvider.java:119)
> 	at org.apache.maven.scm.manager.AbstractScmManager.makeProviderScmRepository(AbstractScmManager.java:267)
> From what I understand the code tries to execute "svn info" to get the repository URL.
> However executing a command always checks that the repository is not null.
> In this case the svn command should be executed in order to be able to create the repository.
> It is not possible to create the repository before, because the URL is not known.
> My suggestion is to revisit this block in AbstractCommand:
>         if ( repository == null )
>         {
>             throw new NullPointerException( "repository cannot be null" );
>         }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira