I use a foreach in Java to pull out the Repository that i require and then do the following...
svnRepositoryInstance = (SvnRepository)repositoryDefinitionInstance.getRepository();
svnRepositoryInstance.setUsername("myUsername");
svnRepositoryInstance.setUserPassword("myPassword");
I would then like to pass the svnRepositoryInstance to a RepositoryDefinition, so that I may put this into the BuildContext RepositoryDefiniton Map....
buildContext.getRepositoryDefinitionMap().put(repositioryDefiintionWithNewData.getId(), repositioryDefiintionWithNewData)
Please tell me how I go about getting a Repository into a RepositoryDefinition , as i cannot seem to find the right way?
Community moderators have prevented the ability to post new answers.
RepositoryDefinition is immutable, you need to create new object with updated xml configuration.
Try this:
svnRepositoryInstance = (SvnRepository) repositoryDefinitionInstance.getRepository(); svnRepositoryInstance.setUsername("myUsername"); svnRepositoryInstance.setUserPassword("myPassword"); RepositoryDefinition repositoryDefinitionWithNewData = new RepositoryDefinitionImpl( repositoryDefinition.getId(), repositoryDefinition.getPluginKey(), repositoryDefinition.getName(), repositoryDefinition.getPosition(), repositoryDefinition.getDescription(), RepositoryConfigHelper.prepareXmlConfigurationString(svnRepositoryInstance, repositoryDefinition.getWebRepositoryViewer()), repositoryDefinition.isBuildTrigger(), repositoryDefinition.isMarkedForDeletion(), repositoryDefinition.isGlobal()); buildContext.getRepositoryDefinitionMap().put(repositoryDefinitionWithNewData.getId(), repositoryDefinitionWithNewData);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.