{"id":15045347,"url":"https://github.com/jenkinsci/subversion-plugin","last_synced_at":"2025-05-15T20:00:39.235Z","repository":{"id":1231204,"uuid":"1163422","full_name":"jenkinsci/subversion-plugin","owner":"jenkinsci","description":"Jenkins subversion plugin","archived":false,"fork":false,"pushed_at":"2025-04-01T15:09:44.000Z","size":2681,"stargazers_count":128,"open_issues_count":26,"forks_count":267,"subscribers_count":107,"default_branch":"master","last_synced_at":"2025-04-08T01:37:36.340Z","etag":null,"topics":["jenkins","jenkins-plugin","scm","subversion","svn"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/subversion","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-13T05:24:54.000Z","updated_at":"2025-04-04T04:18:43.000Z","dependencies_parsed_at":"2024-03-25T07:50:35.777Z","dependency_job_id":"be2ed775-7735-4410-830f-453d8e3b6771","html_url":"https://github.com/jenkinsci/subversion-plugin","commit_stats":{"total_commits":1088,"total_committers":106,"mean_commits":"10.264150943396226","dds":0.8566176470588236,"last_synced_commit":"c8837f91a07a627b95ff2bbab08d74c57142de55"},"previous_names":[],"tags_count":129,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fsubversion-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fsubversion-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fsubversion-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Fsubversion-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/subversion-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414455,"owners_count":22067262,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jenkins","jenkins-plugin","scm","subversion","svn"],"created_at":"2024-09-24T20:51:45.743Z","updated_at":"2025-05-15T20:00:38.748Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Jenkins Subversion Plugin\n=========================\n\n[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/subversion.svg)](https://plugins.jenkins.io/subversion)\n[![GitHub release](https://img.shields.io/github/release/jenkinsci/subversion-plugin.svg?label=release)](https://github.com/jenkinsci/subversion-plugin/releases/latest)\n[![Jenkins Plugin Installs](https://img.shields.io/jenkins/plugin/i/subversion.svg?color=blue)](https://plugins.jenkins.io/subversion)\n\nThis plugin adds the Subversion support (via SVNKit) to Jenkins.\n\n# Basic Usage\n\nOnce this plugin is installed, you'll see Subversion as one of the\noptions in the SCM section of job configurations. See inline help for\nmore information about how to use it.\n\n### Usage with Server Certificates\n\nAn important note for those wanting to use client certificates to\nauthenticate to your subversion server.   Your PKCS12 cert file must not\nhave a blank passphrase or a blank export password as it will cause\nauthentication to fail. Refer to\n[SVNKit:0000271](http://issues.tmatesoft.com/issue/SVNOLD-271 \"SVNKit:0000271\")\nfor more details.\n\n# Advanced Features/Configurations\n\n## Proxy\n\nYou can set the proxy\nin C:/Users/\\\u003cuser\\\u003e/AppData/Roaming/Subversion/servers (Windows)  or\n\\~/.subversion/servers (Linux)\n\n*(Jenkins as a service on Windows\n: C:\\\\Windows\\\\SysWOW64\\\\config\\\\systemprofile\\\\AppData\\\\Roaming\\\\Subversion\\\\servers)*\n\n\u003e There's a tension between doing this in Jenkins vs following the\n\u003e existing Subversion convention — the former has a benefit of being\n\u003e available on all the agents. In this case, the proxy is a system\n\u003e dependent setting, which might be different between different agents,\n\u003e so I think it makes sense to keep it in \\~/.subversion/servers.\n\u003e (See \u003chttps://issues.jenkins-ci.org/browse/JENKINS-4041\u003e)\n\n## Post-commit hook\n\nJenkins can poll Subversion repositories for changes, and while this is\nreasonably efficient, this can only happen up to every once a minute, so\nyou may still have to wait a full minute before Jenkins detects a\nchange.\n\nTo reduce this delay, you can set up [a post commit\nhook](http://svnbook.red-bean.com/en/1.5/svn.reposadmin.create.html#svn.reposadmin.create.hooks)\nso the Subversion repository can notify Jenkins whenever a change is\nmade to that repository. To do this, put the following script in your\n`post-commit` file (in the $REPOSITORY/hooks directory):\n\n    REPOS=\"$1\"\n    REV=\"$2\"\n    UUID=`svnlook uuid $REPOS`\n    /usr/bin/wget \\\n      --header \"Content-Type:text/plain;charset=UTF-8\" \\\n      --post-data \"`svnlook changed --revision $REV $REPOS`\" \\\n      --output-document \"-\" \\\n      --timeout=2 \\\n      http://server/subversion/${UUID}/notifyCommit?rev=$REV\n\nNotice the rev=$REV parameter, this tells Jenkins to check out exactly\nthe revision which was reported by the hook. If your job has multiple\nSubversion module locations defined, this may lead to inconsistent\ncheckouts - so it's recommended to leave out '?rev=$REV' in that case.  \nYou may also want to leave out the '?rev=$REV' parameter if you are\nusing Maven to release your projects and do not want Jenkins to build\nthe intermediate prepare-release commit (ie: the released artifacts).  \nSee [JENKINS-14254](https://issues.jenkins-ci.org/browse/JENKINS-14254)\nfor details.\n\nJobs on Jenkins need to be configured with the SCM polling option to\nbenefit from this behavior. This is so that you can have some jobs that\nare never triggered by the post-commit hook (in the $REPOSITORY/hooks\ndirectory), such as release related tasks, by omitting the SCM polling\noption.\nThe configured polling can have any schedule (probably infrequent like\nmonthly or yearly). The net effect is as if polling happens out of their\nusual cycles.\n\nFor this to work, your Jenkins has to allow anonymous read access\n(specifically, \"Job \\\u003e Read\" access) to the system. If access control to\nyour Jenkins is more restrictive, you may need to specify the username\nand password, depending on how your authentication is configured.\n\nIf your Jenkins uses the \"Prevent Cross Site Request Forgery exploits\"\nsecurity option, the above request will be rejected with 403 errors (\"No\nvalid crumb was included\"). The crumb needed in this request can be\nobtained from the URL `http:``//server/crumbIssuer/api/xml` (or\n`/api/json`). This can be included in the wget call above with something\nlike this:\n\n    --header `wget -q --output-document - \\\n      'http://server/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)'`\n\n### Considerations\n\nSince `wget` by default retries up to **20 times** when not succeeding\nwithin the given timeout, `--timeout=2` on a slow SVN server may cause\nJenkins to scan the repository many more times than needed, further\nslowing down the SVN Server which after a while makes Jenkins\nunresponsive.\n\nPossible solutions to this problem are to increase the timeout, to add a\nlower maximum number of retries using the argument `--retries=3` or to\nmake the `wget` call asynchronous (and thus ignoring any communication\nerrors) by adding `2\u003e\u00261 \u0026` last on the `wget` call.\n\nHaving the timeout too low can also cause your commits to hang and throw\neither 502 errors if you are behind a proxy, or post-commit errors if\nnot.  Increasing the timeout until you no longer see wget retrying\nshould fix the issue.\n\n###  More robust \\*nix post-commit hook example\n\nThe basic script above is fine if your server does not do authentication\nor you have no problem providing anonymous read access to Jenkins (as\nwell as anonymous read to all the individual jobs you want to trigger if\nyou are using project-based matrix authorization). Here is a script that\nincludes the more robust security concepts hinted at in the basic\nexample. \n\n    #!/bin/sh\n    REPOS=\"$1\"\n    REV=\"$2\"\n\n    # No environment is passed to svn hook scripts; set paths to external tools explicitly:\n    WGET=/usr/bin/wget\n    SVNLOOK=/usr/bin/svnlook\n\n    # If your server requires authentication, it is recommended that you set up a .netrc file to store your username and password\n    # Better yet, since Jenkins v. 1.426, use the generated API Token in place of the password\n    # See https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients\n    # Since no environment is passed to hook scripts, you need to set $HOME (where your .netrc lives)\n    # By convention, this should be the home dir of whichever user is running the svn process (i.e. apache)\n    HOME=/var/www/\n\n    UUID=`$SVNLOOK uuid $REPOS`\n    NOTIFY_URL=\"subversion/${UUID}/notifyCommit?rev=${REV}\"\n    CRUMB_ISSUER_URL='crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\",//crumb)'\n\n    function notifyCI {\n        # URL to Jenkins server application (with protocol, hostname, port and deployment descriptor if needed)\n        CISERVER=$1\n\n        # Check if \"[X] Prevent Cross Site Request Forgery exploits\" is activated\n        # so we can present a valid crumb or a proper header\n        CONTENT_TYPE_HEADER=\"--header Content-Type:text/plain;charset=UTF-8\"\n        CRUMB=`$WGET --auth-no-challenge --output-document - ${CISERVER}/${CRUMB_ISSUER_URL}`\n        if [ \"$CRUMB\" != \"\" ]; then CRUMB_HEADER=\"--header $CRUMB\"; fi\n\n        $WGET \\\n            --auth-no-challenge \\\n            $CONTENT_TYPE_HEADER \\\n            $CRUMB_HEADER \\\n            --post-data \"`$SVNLOOK changed --revision $REV $REPOS`\" \\\n            --output-document \"-\"\\\n            --timeout=2 \\\n            ${CISERVER}/${NOTIFY_URL}\n    }\n\n    # The code above was placed in a function so you can easily notify multiple Jenkins servers:\n    notifyCI \"http://myPC.company.local:8080\"\n    notifyCI \"http://jenkins.company.com:8080/jenkins\"\n\nThe script above takes care of the Prevent Cross Site Request Forgery\nexploits option if you have it enabled on your server. If you do not\nhave that option enabled, the extra wget call is harmless, but feel free\nto remove it if you do not need it. The script above also requires that\nyou set up a .netrc file in the home directory of the user you are\nrunning subversion as (either the svnserve process or httpd). For more\ninfo on .netrc file syntax, look\n[here](http://www.mavetju.org/unix/netrc.php). The\nscript above makes it easy to notify multiple Jenkins servers of the\nsame SVN commit. If you have a .netrc file, it keeps it easy even if\nthey have different admin users set up. If you don't want to mess with a\n.netrc file, you could just hard-code the user and password (or API\nToken) info in the file and add --username=user and --password=\"pass\"\nflags to the wget calls. \n\n### Windows specific post-commit hook\n\nThe above script is difficult under the Windows command processor seeing\nas there is no support for backtick output extraction and there is no\nbuilt in wget command. Instead the following contents can be added to\n`post-commit.bat` (in the $REPOSITORY/hooks directory):\n\n    SET REPOS=%1\n    SET REV=%2\n    SET CSCRIPT=%windir%\\system32\\cscript.exe\n    SET VBSCRIPT=C:\\Repositories\\post-commit-hook-jenkins.vbs\n    SET SVNLOOK=C:\\Subversion\\svnlook.exe\n    SET JENKINS=http://server/\n    REM AUTHORIZATION: Set to \"\" for anonymous acceess\n    REM AUTHORIZATION: Set to encoded Base64 string, generated from \"user_id:api_token\" \n    REM                found on Jenkins under \"user/configure/API token\"\n    REM                User needs \"Job/Read\" permission on Jenkins\n    SET AUTHORIZATION=\"\"\n    \"%CSCRIPT%\" \"%VBSCRIPT%\" \"%REPOS%\" %2 \"%SVNLOOK%\" %JENKINS% %AUTHORIZATION%\n\nThe batch file relies on the following VBScript being available in the\nfile designated by the `VBSCRIPT` variable above:\n\n    repos         = WScript.Arguments.Item(0)\n    rev           = WScript.Arguments.Item(1)\n    svnlook       = WScript.Arguments.Item(2)\n    jenkins       = WScript.Arguments.Item(3)\n    authorization = WScript.Arguments.Item(4)\n\n    Set shell = WScript.CreateObject(\"WScript.Shell\")\n\n    Set uuidExec = shell.Exec(svnlook \u0026 \" uuid \" \u0026 repos)\n    Do Until uuidExec.StdOut.AtEndOfStream\n      uuid = uuidExec.StdOut.ReadLine()\n    Loop\n    Wscript.Echo \"uuid=\" \u0026 uuid\n\n    Set changedExec = shell.Exec(svnlook \u0026 \" changed --revision \" \u0026 rev \u0026 \" \" \u0026 repos)\n    Do Until changedExec.StdOut.AtEndOfStream\n      changed = changed + changedExec.StdOut.ReadLine() + Chr(10)\n    Loop\n    Wscript.Echo \"changed=\" \u0026 changed\n\n    url = jenkins + \"crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\"\":\"\",//crumb)\"\n    Set http = CreateObject(\"Microsoft.XMLHTTP\")\n    http.open \"GET\", url, False\n    http.setRequestHeader \"Content-Type\", \"text/plain;charset=UTF-8\"\n    if not authorization = \"\" then\n      http.setRequestHeader \"Authorization\", \"Basic \" + authorization\n    end if\n    http.send\n    crumb = null\n    if http.status = 200 then\n      crumb = split(http.responseText,\":\")\n    end if\n\n    url = jenkins + \"subversion/\" + uuid + \"/notifyCommit?rev=\" + rev\n    Wscript.Echo url\n\n    Set http = CreateObject(\"Microsoft.XMLHTTP\")\n    http.open \"POST\", url, False\n    http.setRequestHeader \"Content-Type\", \"text/plain;charset=UTF-8\"\n    if not authorization = \"\" then\n      http.setRequestHeader \"Authorization\", \"Basic \" + authorization\n    end if\n    if not isnull(crumb) then \n      http.setRequestHeader crumb(0),crumb(1)\n    end if\n    http.send changed\n    if http.status \u003c\u003e 200 then\n      Wscript.Echo \"Error. HTTP Status: \" \u0026 http.status \u0026 \". Body: \" \u0026 http.responseText\n    end if\n\n## Perform Polling from the Controller\n\nJIRA [JENKINS-5413](https://issues.jenkins-ci.org/browse/JENKINS-5413)\ndocuments problems with running the SCM polling trigger on agents.\nVersion 1.21 of the Subversion plugin can perform the polling on the\nJenkins controller if the hudson.scm.SubversionSCM.pollFromMaster system\nproperty is set to true.\n\n## Subversion Revision and URL information as Environment Variables\n\nThe Subversion SCM plugin exports the svn revisions and URLs of the\nbuild's subversion modules as environment variables. These\nare $SVN\\_REVISION\\_n and $SVN\\_URL\\_n, where n is the 1-based index of\nthe module in the configuration.\n\nFor backwards compatibility if there's only a single module, its values\nare also exported as $SVN\\_REVISION and $SVN\\_URL.\n\nNote that the revision number exposed is the 'last-changed' revision\nnumber of the particular directory and not the current revision of the\nrepository. (See [What are these two revision numbers in svn\ninfo?](http://stackoverflow.com/questions/9354877/what-are-these-two-revision-numbers-in-svn-info))\n\n## Kerberos authentication\n\nTo connect to a Kerberos authenticated SVN repository see the\n[Subversion Plugin HTTPS Kerberos\nauthentication](https://wiki.jenkins.io/display/JENKINS/Subversion+Plugin+HTTPS+Kerberos+authentication)\npage.\n\n# TroubleShooting\n\nSomeone suggested in the Jenkins IRC channel that if you are getting an\nerror and a long svnkit stack trace that looks like:\n\n     ERROR: svn: authentication cancelled\n\n    org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled\n\nThen,\n\n-   Try to delete (back up) the \\~/.subversion folder and retry the\n    build. Apparently mixing the command line svn client checkouts with\n    those of your Jenkins jobs messes it up.\n-   See\n    \u003chttp://blog.vinodsingh.com/2009/08/hudson-svn-authentication-cancelled.html\u003e\n    for details.\n\n  \n\nYou could try to enable verbose log over the plugin an SVNKit library,\nto do that add a logger to those loggers with log level ALL , it is\nreally verbose so just after configure it make the test and change the\nlog level again to ERROR or INFO.\n\n-   svnkit\n-   svnkit-network\n-   svnkit-wc\n-   hudson.scm.SubversionSCM\n\n![](docs/images/logger.png){.confluence-embedded-image\nheight=\"250\"}\n\n  \n\n## lightweight checkout capability for Subversion on Multibranch Pipeline projects and Externals support\n\nLightweight checkout capability for Subversion on Multibranch Pipeline\nprojects does not support externals, so in order to use Subversion\nplugin in a Multibranch Pipeline project with a repository with\nexternals, you should disable the lightweight checkout capability by\nsetting the property\n\\`-Djenkins.scm.impl.subversion.SubversionSCMFileSystem.disable=\\\u003ctrue/false\\\u003e\\`\n\n# Change Log\n\n## Version 2.12.2 and newer\n\nSee [GitHub releases](https://github.com/jenkinsci/subversion-plugin/releases).\n\n## Older\n\nSee the [old changelog](docs/old-changelog.md).\n\n# Trademarks\n\nApache, Apache Subversion and Subversion are trademarks of the Apache\nSoftware Foundation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fsubversion-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Fsubversion-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Fsubversion-plugin/lists"}