Skip to content

Commit

Permalink
upgrade gradle and handle empty git credentails
Browse files Browse the repository at this point in the history
  • Loading branch information
assafkamil committed Jan 2, 2021
1 parent 2d68dc7 commit 39d75c8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.geekoosh'
version '0.0.2'
version '0.0.3'

apply plugin: 'java'

Expand All @@ -22,14 +22,18 @@ buildscript {
}
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:1.0.3.RELEASE"
classpath "com.github.jengelman.gradle.plugins:shadow:2.0.1"
classpath "com.github.jengelman.gradle.plugins:shadow:6.1.0"
classpath 'ca.cutterslade.gradle:gradle-dependency-analyze:1.3.3'
}
}

apply plugin: "io.spring.dependency-management"
apply plugin: 'com.github.johnrengelman.shadow'

shadowJar {
archiveFileName = "flyway-all.jar"
}

dependencyManagement {
imports {
mavenBom 'com.amazonaws:aws-java-sdk-bom:1.11.623'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-rc-2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
8 changes: 5 additions & 3 deletions src/main/java/com/geekoosh/lambda/git/GitService.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ public void cloneRepo() throws MigrationFilesException {
logger.info("Fetching from branch " + branchRef());

CloneCommand cloneCmd = Git.cloneRepository();
if(gitRequest.getUsername() != null && gitRequest.getPassword() != null) {
cloneCmd = cloneCmd.setCredentialsProvider(new UsernamePasswordCredentialsProvider(
gitRequest.getUsername(), gitRequest.getPassword()
));
}
cloneCmd
.setCredentialsProvider(new UsernamePasswordCredentialsProvider(
gitRequest.getUsername(), gitRequest.getPassword()
))
.setURI(gitRequest.getGitRepository())
.setBranchesToClone(Collections.singletonList(branchRef()))
.setBranch(branchRef())
Expand Down

0 comments on commit 39d75c8

Please sign in to comment.