Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.ProjectKaiser:pk-vcs-svn:16.0'
}
dependencies {
implementation("com.github.ProjectKaiser:pk-vcs-svn:16.0")
}
<dependency>
<groupId>com.github.ProjectKaiser</groupId>
<artifactId>pk-vcs-svn</artifactId>
<version>16.0</version>
</dependency>
libraryDependencies += "com.github.ProjectKaiser" % "pk-vcs-svn" % "16.0"
:dependencies [[com.github.ProjectKaiser/pk-vcs-svn "16.0"]]
scm4j-vcs-svn is lightweight library for execute basic SVN VCS operations (merge, branch create etc). It uses scm4j-vcs-api exposing IVCS implementation for SVN repositories and SVNKit as framework to work with SVN repositories. Features:
Use cases
Add github-hosted scm4j-vcs-svn project as maven dependency using jitpack.io. As an example, add following to gradle.build file:
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
dependencies {
// versioning: master-SNAPSHOT (lastest build, unstable), + (lastest release, stable) or certain version (e.g. 1.1)
compile 'com.github.scm4j:scm4j-vcs-svn:+'
}
Or download release jars from https://github.com/scm4j/scm4j-vcs-svn/releases
Code snippet
public static final String WORKSPACE_DIR = System.getProperty("java.io.tmpdir") + "svn-workspaces";
IVCSWorkspace workspace = new VCSWorkspace(WORKSPACE_DIR);
String repoUrl = "https://github.com/MyUser/MyRepo";
IVCSRepositoryWorkspace repoWorkspace = workspace.getVCSRepositoryWorkspace(repoUrl);
IVCS vcs = new SVNVCS(repoWorkspace, "username", "pass");
IVCS
interface. See scm4j-vcs-api for detailsvcs.setProxy()
and vcs.setCredentials()
if necessarygradle test
IVCS.getBranches()
should return list of user-created branches. But a branch and a dir are the same for SVN. So SVNVCS.getBranches()
returns set of first-level folders of "Branches/" branch and "Trunk" branch. I.e.:
SVNVCS.getBranches()
method will return [Br1, Br2, Trunk]