Skip to content
Permalink
Browse files

Merge pull request #4 from rinokadijk/master

FIXED: JENKINS-21797  Subversion-Tagging Plugin can't create tag because of missing credentials
  • Loading branch information...
scoopex committed Mar 27, 2014
2 parents edee3b6 + 4e17b32 commit 27285688a13f32b8e47643f0ea3aa2a460686ce0
Showing with 19 additions and 25 deletions.
  1. +1 −1 pom.xml
  2. +18 −24 src/main/java/hudson/plugins/svn_tag/SvnTagPlugin.java
@@ -38,7 +38,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>subversion</artifactId>
<version>[1.28,)</version>
<version>[2.2,)</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
@@ -4,22 +4,17 @@
import groovy.lang.GroovyShell;
import hudson.EnvVars;
import hudson.Launcher;
import hudson.model.*;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.Result;
import hudson.scm.SubversionSCM;
import org.apache.commons.lang.StringUtils;
import org.codehaus.groovy.control.CompilerConfiguration;
import org.tmatesoft.svn.core.SVNCommitInfo;
import org.tmatesoft.svn.core.SVNErrorMessage;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.SVNProperties;
import org.tmatesoft.svn.core.SVNURL;
import org.tmatesoft.svn.core.*;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager;
import org.tmatesoft.svn.core.auth.ISVNAuthenticationProvider;
import org.tmatesoft.svn.core.wc.SVNCommitClient;
import org.tmatesoft.svn.core.wc.SVNCopyClient;
import org.tmatesoft.svn.core.wc.SVNCopySource;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.wc.SVNWCUtil;
import org.tmatesoft.svn.core.wc.*;

import java.io.*;
import java.net.URI;
@@ -105,19 +100,6 @@ public static boolean perform(AbstractBuild<?,?> abstractBuild,
return false;
}

ISVNAuthenticationProvider sap =
scm.getDescriptor().createAuthenticationProvider(rootProject);
if (sap == null) {
logger.println(Messages.NoSVNAuthProvider());
return false;
}

ISVNAuthenticationManager sam =
SVNWCUtil.createDefaultAuthenticationManager();
sam.setAuthenticationProvider(sap);

SVNCommitClient commitClient = new SVNCommitClient(sam, null);

for (SubversionSCM.ModuleLocation ml : scm.getLocations(envVars, rootBuild)) {
String mlUrl;
URI repoURI;
@@ -156,6 +138,18 @@ public static boolean perform(AbstractBuild<?,?> abstractBuild,
evaledTagBaseURLStr, e.getLocalizedMessage()));
}

ISVNAuthenticationProvider sap = scm.createAuthenticationProvider(rootProject, ml);

if (sap == null) {
logger.println(Messages.NoSVNAuthProvider());
return false;
}

ISVNAuthenticationManager sam =
SVNWCUtil.createDefaultAuthenticationManager();
sam.setAuthenticationProvider(sap);

SVNCommitClient commitClient = new SVNCommitClient(sam, null);
try {
String evalDeleteComment = evalGroovyExpression(
envVars, tagDeleteComment, locationPathElements);

0 comments on commit 2728568

Please sign in to comment.
You can’t perform that action at this time.