Like arghtype suggested, you need to be using Jenkin's own Source Code Management by configuring SVN as SCM source and supplying credentials as part of Maven build job.
If you have to use your own local working copy, you are organizing it wrong, you will lose on all the benefits of having Jenkins manage SVN changes, and in the end, this organization will give you more unsolvable problems in the future. Think about the advice people are giving here and come with up a reason why you need to have a local workspace outside of Jenkins management on a Jenkins build machine. My only guess is: your Jenkins and Development machine are the same. That again is not how it should be organized. Jenkins is a CI-server, not a personal build "automator".
Regardless, if you still want to do what you say.
What you think you want
- Create a new Freestyle job
- Under Build Steps, click Add build step
- Select Execute Windows batch command
- Write your batch execute command in there. Your working directory will be Jenkins's
$WORKSPACE
, so change your path accordingly to where you want to run it.
But with the above configuration, you might have as well put the batch file under windows scheduler... You are not really using Jenkins with the above.
What you should do instead
- Create a new maven2/3 build job
- Under Source Code Management, select Subversion
- Under Repository URL enter the remote SVN repo (i.e.
http://your.svnsever.com/path/to/project
) - Under Build, enter your Root POM location (this will be relative to the location of your SVN checkout, so if your POM is under
http://your.svnserver.com/path/to/project/maven/pom.xml
, then entermaven/pom.xml
. - Under Goals and options, enter
clean install
- Click Save
The Source Code Management section will take care of setting up a local workspace and checkout the repository into that workspace. By default, every time a new build is triggered, it will run svn update
on that workspace for you.
The Maven Build step will take care of running your Maven, however note that it is configured to use default ~/.m2/repository
location. If your local maven repo needs to be different, change this under Jenkins Global Configuration