diff --git a/build.gradle b/build.gradle index 3733de8..2fec016 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ tasks.withType(GroovyCompile) { options.encoding = 'UTF-8' } group = 'com.blackducksoftware.integration' -version = '0.0.1-SNAPSHOT' +version = '0.0.1' sourceCompatibility = 1.7 targetCompatibility = 1.7 diff --git a/src/main/groovy/com/blackducksoftware/integration/hub/detect/model/DetectProject.groovy b/src/main/groovy/com/blackducksoftware/integration/hub/detect/model/DetectProject.groovy index 6906547..0fd2024 100644 --- a/src/main/groovy/com/blackducksoftware/integration/hub/detect/model/DetectProject.groovy +++ b/src/main/groovy/com/blackducksoftware/integration/hub/detect/model/DetectProject.groovy @@ -57,13 +57,19 @@ class DetectProject { } public String getCodeLocationName(final BomToolType bomToolType, String finalSourcePathPiece, String prefix, String suffix) { - String codeLocation = String.format('%s/%s/%s/%s/%s %s', prefix, bomToolType.toString(), finalSourcePathPiece, projectName, projectVersionName, suffix) + String codeLocation = String.format('%s/%s/%s/%s %s', bomToolType.toString(), finalSourcePathPiece, projectName, projectVersionName, suffix) + if (prefix) { + codeLocation = String.format('%s/%s', prefix, codeLocation) + } codeLocation } public String getCodeLocationName(final String canonicalProjectSourcePath, final String canonicalCodeLocationSourcePath, String finalSourcePathPiece, String prefix, String suffix) { String sourcePath = canonicalCodeLocationSourcePath.replace(canonicalProjectSourcePath, finalSourcePathPiece); - String codeLocation = String.format('%s/%s/%s/%s %s', prefix, sourcePath, projectName, projectVersionName, suffix) + String codeLocation = String.format('%s/%s/%s %s', sourcePath, projectName, projectVersionName, suffix) + if (prefix) { + codeLocation = String.format('%s/%s', prefix, codeLocation) + } codeLocation }