Anandhakrishnan
Anandhakrishnan

Reputation: 548

Calling SVN commands from a java program

I want to call SVN commands (update , commit) from a java program. any help ?

SVN : Tortoise SVN Environment : java program will be running inside a jBoss server.

Upvotes: 8

Views: 9036

Answers (5)

Michael Borgwardt
Michael Borgwardt

Reputation: 346270

It's a really, really bad idea to use a GUI SVN client from within an app server. While TortoiseSVN can be scripted, it's still a GUI application, and an unexpected situation can cause it to pop up a dialog on your server (and some tasks may always open a dialog).

It,s much, much better ot use a Java implementation of SVN, such as SvnKit - then you can work with a nice Java API and your question becomes moot.

Upvotes: 9

Noel M
Noel M

Reputation: 16116

A quick Google search brought up http://svnkit.com/

Upvotes: 2

Sean Patrick Floyd
Sean Patrick Floyd

Reputation: 298858

Sure, there are several libraries out there that do the job. Personally, I'd either go with SVNKit or with the Maven SCM abstraction (the latter is less powerful but more portable).

Upvotes: 5

shams
shams

Reputation: 3508

You can consider using SVNKit, a java library for interacting with SVN workspaces. It is used by IntelliJ and Eclipse plugins to provide SVN support.

Upvotes: 2

Rup
Rup

Reputation: 34408

It's probably simplest to use SVNKit which is a native implementation of SVN in Java, provided you can get the version to match your command-line client version if you need to share working copies between them.

It's under a copy-left-ish licence, but as long as you're running the code on your own server and not distributing it that should be OK (but IANAL, etc.)

Upvotes: 4

Related Questions