MavenModuleSet template = (MavenModuleSet) jenkins.getItem("template-job");
MavenModuleSet newJob = (MavenModuleSet) jenkins.copy((TopLevelItem) template, "new-job-name");
GitSCM gitScm = (GitSCM) newJob.getScm();
List<RemoteConfig> repositories = gitScm.getRepositories();
if (repositories.size() != 1) {
throw new IllegalStateException("Just one repository was expected and there are " + repositories.size());}
RemoteConfig repository = repositories.get(0);
repository.removeURI(new URIish("${REPOSITORY_URL}"));
String newUrl = "http://domain.com/project.git"
repository.addURI(new URIish(url));--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/cb67d0da-3d96-478b-a024-d79445f48b7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b42df2ac-e7c6-4c00-825f-491aa6b6ee12%40googlegroups.com.