Hudson svn credentials

谁说胖子不能爱 提交于 2019-12-19 03:25:10

问题


How to enter subversion credentials in Hudson by shell? I've tried to generate file hudson.scm.SubversionSCM.xml in HUDSON_HOME and reload configuration, but changes weren't applied.


回答1:


The easiest way to enter a credential from the shell is to use "svn" executable. Hudson recognizes the ~/.subversion/auth directory that it creates.




回答2:


Under Windows the global credenentials are stored under %APPDATA%\Subversion\auth. The following Groovy code helps generating these credentials:

SVNRepository repository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(url))
ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(SVNWCUtil.defaultConfigurationDirectory,"AD\user","password",true)
repository.setAuthenticationManager(authManager)
repository.getDir("", -1, null ,(Collection)null) // or some random SVN operation

Libraries used in the code above (example in Gradle):

compile 'org.tmatesoft.svnkit:org.tmatesoft.svnkit:1.7.8'
compile 'net.java.dev.jna:jna:3.4.0' // so wincrypt is available

Make sure you run the code with the same user Hudson runs on the Windows machine.




回答3:


Just start with the Hudson. Install all required Plug-Ins. Hit the link,EX:-localhost:8080/hudson Click on the add job/Create job. While choosing the options SVN will be present there,Give the SVN location. Credentials link is present out there.Click on that link. A form will get open,provide valid credentials for that location of SVN. Observe the Success message on the screen and then get back to the Create job,Complete with Job creation and Build the task.



来源:https://stackoverflow.com/questions/4541060/hudson-svn-credentials

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!