versioning icon indicating copy to clipboard operation
versioning copied to clipboard

SVN isn't working with url http://W.X.Y.Z/svn/company/branches/branch-name/project

Open Bno93 opened this issue 7 years ago • 6 comments

If I try to use this extension under SVN I always get The SVN URL cannot be identified as a trunk or a branch: http://192.168.0.1/svn/company/branches/branch-name/project

I looked into the code and found out that in SVNInfoService.groovy in function parseBranch the Pattern /.*\/trunk$/ and /.*\/branches\/([^\/]+)$/ in combination with match() don't work for me.

It worked when I remove the '$' in both Patterns and use find() instead of match().

Did someone else had this problem?

Bno93 avatar Dec 05 '18 13:12 Bno93

Hi, thanks for reporting this.

Do you configure the plugin in any way, in your build.gradle? If yes, can you post the configuration?

Thanks, Damien

dcoraboeuf avatar Dec 11 '18 19:12 dcoraboeuf

And which version of the plugin do you use?

dcoraboeuf avatar Dec 11 '18 19:12 dcoraboeuf

Hi, thanks for the reply.

i'm currently using 2.7.1. add the dependency:

buildscript {  
  repositories {  
    jcenter()  
    maven {  
      url "https://plugins.gradle.org/m2/"  
    }  
  }  
  dependencies {
    classpath 'net.nemerosa:versioning:2.7.1'
  }
}
apply plugin: 'net.nemerosa.versioning'

the only thing I've done was to configure the plugin like

versioning {
   scm = 'svn'
}

then I got > org.tmatesoft.svn.core.SVNAuthenticationException: svn: E170001: Authentication required for '<http://x.x.x.x:80>'

when I enter my svn credentials like

versioning {
   scm = 'svn'
   user = 'myUser'
   password = 'myPassword'
}

I got

> The SVN URL cannot be identified as a 'trunk' or a branch: http://x.x.x.x/svn/Repo/trunk/project-group/project

Bno93 avatar Dec 12 '18 07:12 Bno93

Hi,

By default, the versioning plugin expects your local working copy to be either:

  • a trunk
  • a branch (defined by branches/xxx)

In your case, it is mapped to /trunk/project-group/project hence the failure.

That's a default though, computing the current branch from the working directory. You can also pass the branch name explicitly in the branchEnv, for example:

versioning {
   branchEnv = 'BRANCH_NAME'
}

Then, set the environment locally (for Linux/MacOs):

export BRANCH_NAME=trunk

Not perfect, but as of now, this plugin does a best effort to use a default layout for Subversion, difficult to take into account all possible configurations, especially with Subversion.

dcoraboeuf avatar Dec 15 '18 19:12 dcoraboeuf

Thanks for the workaround I will try it ^^

Bno93 avatar Dec 17 '18 07:12 Bno93

I've got the same error when I try to build from a SVN tag. This is blocking in our company as tags are used in our pipeline to build and deliver apps to the production environment.

Taeradan avatar Oct 17 '19 09:10 Taeradan