diff --git a/src/main/java/org/jenkinsci/plugins/genexus/server/GeneXusServerSCM.java b/src/main/java/org/jenkinsci/plugins/genexus/server/GeneXusServerSCM.java index d33f4cb..48e704e 100644 --- a/src/main/java/org/jenkinsci/plugins/genexus/server/GeneXusServerSCM.java +++ b/src/main/java/org/jenkinsci/plugins/genexus/server/GeneXusServerSCM.java @@ -186,12 +186,18 @@ private GeneXusInstallation getGeneXusInstallation(@CheckForNull FilePath worksp } private String getGxPath(@CheckForNull FilePath workspace, @CheckForNull EnvVars env, @NonNull TaskListener listener) { + // check for custom path first + String customPath = getGxCustomPath(); + if (customPath != null && !customPath.isEmpty()) { + return customPath; + } + GeneXusInstallation installation = getGeneXusInstallation(workspace, env, listener); if (installation != null) { return installation.getHome(); } - return getGxCustomPath(); + return ""; } private String getMSBuildInstallationId(@CheckForNull FilePath workspace, @CheckForNull EnvVars env, @NonNull TaskListener listener) { @@ -204,6 +210,12 @@ private String getMSBuildInstallationId(@CheckForNull FilePath workspace, @Check } private String getMsBuildPath(@CheckForNull FilePath workspace, @CheckForNull EnvVars env, @NonNull TaskListener listener) { + // check for custom path first + String customPath = getMsbuildCustomPath(); + if (customPath != null && !customPath.isEmpty()) { + return customPath; + } + String installationId = getMSBuildInstallationId(workspace, env, listener); Node node = workspaceToNode(workspace); MsBuildInstallation msbuildTool = MsBuildInstallationHelper.resolveInstallation(installationId, node, env, listener); @@ -211,7 +223,7 @@ private String getMsBuildPath(@CheckForNull FilePath workspace, @CheckForNull En return msbuildTool.getHome(); } - return getMsbuildCustomPath(); + return ""; } @Exported