File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/com/e_gineering/maven/gitflowhelper Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,12 @@ public abstract class ScmUtils {
1616 public static String getGitBranch (ScmManager scmManager , MavenProject project ) throws ScmException {
1717 String scmConnectionUrl = project .getScm ().getConnection ();
1818 String scmDeveloperConnectionUrl = project .getScm ().getDeveloperConnection ();
19- ScmRepository repository = scmManager .makeScmRepository (StringUtils .isNotBlank (scmDeveloperConnectionUrl ) ? scmDeveloperConnectionUrl : scmConnectionUrl );
19+ String connectionUrl = StringUtils .isNotBlank (scmDeveloperConnectionUrl ) ? scmDeveloperConnectionUrl : scmConnectionUrl ;
20+ if (StringUtils .isBlank (connectionUrl )) {
21+ return "${env.GIT_BRANCH}" ;
22+ }
23+
24+ ScmRepository repository = scmManager .makeScmRepository (connectionUrl );
2025 ScmProvider provider = scmManager .getProviderByRepository (repository );
2126 if (!GitScmProviderRepository .PROTOCOL_GIT .equals (provider .getScmType ())) {
2227 return null ;
You can’t perform that action at this time.
0 commit comments