mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
do not use TokenMacro if stringwithmacro is null
This commit is contained in:
1 parent
f202054c67
commit
477292ae3c
3 files changed
+30
-23
No files matched your search
@@ -95,6 +95,7 @@ import org.apache.maven.project.ProjectBuildingException;
|
||||
import org.codehaus.plexus.PlexusConstants;
|
||||
import org.codehaus.plexus.configuration.DefaultPlexusConfiguration;
|
||||
import org.codehaus.plexus.util.PathTool;
|
||||
import org.jenkinsci.plugins.tokenmacro.MacroEvaluationException;
|
||||
import org.jenkinsci.plugins.tokenmacro.TokenMacro;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import org.kohsuke.stapler.StaplerResponse;
|
||||
@@ -525,12 +526,14 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
|
||||
|
||||
public String getMavenOpts(TaskListener listener) {
|
||||
String opts = project.getMavenOpts();
|
||||
|
||||
if (opts == null ) return null;
|
||||
try {
|
||||
opts = TokenMacro.expand(this, listener, opts);
|
||||
} catch (MacroEvaluationException e) {
|
||||
listener.error( "Ignore MacroEvaluationException " + e.getMessage() );
|
||||
}
|
||||
catch(Exception tokenException) {
|
||||
listener.error("Problem expanding maven opts macros");
|
||||
listener.error("Ignore Problem expanding maven opts macros " + tokenException.getMessage());
|
||||
}
|
||||
catch(LinkageError linkageError) {
|
||||
// Token plugin not present. Ignore, this is OK.
|
||||
|
||||
Reference in new issue
Block a user