SVN isn't working with url http://W.X.Y.Z/svn/company/branches/branch-name/project
Bno93 opened this issue · 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?
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
And which version of the plugin do you use?
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
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.
Thanks for the workaround I will try it ^^
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.