Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-585

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Auto Closed
    • 1.4
    • None
    • maven-scm-api
    • None

    Description

      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" );
              }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            joerg@j-hohwiller.de Jörg Hohwiller
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: