Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Bno93 opened this issue Dec 5, 2018 · 6 comments
Labels

Comments

@Bno93
Copy link

Bno93 commented Dec 5, 2018

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?

@dcoraboeuf dcoraboeuf added the svn label Dec 11, 2018
@dcoraboeuf
Copy link
Contributor

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
Copy link
Contributor

And which version of the plugin do you use?

@Bno93
Copy link
Author

Bno93 commented Dec 12, 2018

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

@dcoraboeuf
Copy link
Contributor

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.

@Bno93
Copy link
Author

Bno93 commented Dec 17, 2018

Thanks for the workaround I will try it ^^

@Taeradan
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants