-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
315 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This gradle.properties should be copied over to your ~/.gradle/gradle.properties | ||
# And configure your environment specific setting and credentials there. Not here. | ||
repoUrl = http://repoUrl | ||
repoUser = repoUser | ||
repoPass = repoPass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,36 @@ | ||
// Resolving Custom Plugin Repositories for plugins {} DSL - but not working! So, just use buildscript {} block | ||
// https://stackoverflow.com/questions/51773218/why-does-gradle-not-look-in-the-local-maven-repository-for-plugins/51775637 | ||
// https://docs.gradle.org/current/userguide/plugins.html#sec:custom_plugin_repositories | ||
// https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_management | ||
// https://stackoverflow.com/questions/37285413/how-can-the-gradle-plugin-repository-be-changed | ||
// | ||
//pluginManagement { | ||
// repositories { | ||
// mavenLocal() | ||
// gradlePluginPortal() | ||
// } | ||
//} | ||
// NOTE: This could also be done globally at ~/.gradle/init.gradle. See above links. | ||
// | ||
// NOTE: The repoUrl property need to specify protocol handler such as 'http://repoUrl'. | ||
// Otherwise it will fall back to 'file://' protocol and will get: | ||
// Authentication scheme 'all'(Authentication) is not supported by protocol 'file' error. | ||
// See | ||
// https://stackoverflow.com/questions/43809688/authentication-error-when-publishing-from-gradle-to-nexus | ||
// | ||
pluginManagement { | ||
repositories { | ||
mavenLocal() | ||
gradlePluginPortal() | ||
jcenter() | ||
mavenCentral() | ||
|
||
// can resolve these variables from gradle.properties | ||
println repoUrl | ||
println repoUser | ||
println repoPass | ||
|
||
maven { | ||
url "$repoUrl/repository/maven-public/" | ||
name = "Banana" | ||
credentials { | ||
username repoUser | ||
password repoPass | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
rootProject.name = 'banana-app' |
81 changes: 52 additions & 29 deletions
81
07-platform-bom-build/gradle/banana-platform/build.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,68 @@ | ||
plugins { | ||
id 'java-platform' | ||
id 'maven-publish' | ||
id 'java-platform' | ||
id 'maven-publish' | ||
id 'com.diffplug.gradle.spotless' version '3.18.0' | ||
} | ||
|
||
repoUrl = getProperty('repoUrl') | ||
repoUser = getProperty('repoUser') | ||
repoPass = getProperty('repoPass') | ||
println 'gradle.properties: ' + repoUrl + ' ' + repoUser + ' ' + repoPass | ||
|
||
group = 'com.sankholin.banana' | ||
version = '3.0.0-SNAPSHOT' | ||
|
||
repositories { | ||
jcenter() | ||
mavenLocal() | ||
jcenter() | ||
mavenLocal() | ||
} | ||
|
||
javaPlatform { | ||
allowDependencies() | ||
} | ||
javaPlatform { allowDependencies() } | ||
|
||
dependencies { | ||
// Inherent BOM or platform | ||
api enforcedPlatform('org.springframework.boot:spring-boot-dependencies:2.1.3.RELEASE') | ||
|
||
// We may also define common dependencies here, but it seems doing such way is discouraged | ||
//api 'org.projectlombok:lombok' | ||
|
||
constraints { | ||
// Constraint the version on those who like to consume Banana platform or BOM | ||
api 'com.sankholin.banana:banana-sim-core:1.1.0' | ||
api 'com.sankholin.banana:banana-domain:3.0.0-SNAPSHOT' | ||
api 'com.sankholin.banana:banana-service:3.0.0-SNAPSHOT' | ||
api 'com.sankholin.banana:banana-utils:3.0.0-SNAPSHOT' | ||
|
||
// It can be also some external libraries. | ||
//api 'commons-httpclient:commons-httpclient:3.1' | ||
//api 'org.apache.commons:commons-lang3:3.8.1' | ||
//runtime 'org.postgresql:postgresql:42.2.5' | ||
} | ||
// Inherent Spring Boot Gradle Java Platform Plugin (aka Spring Boot BOM) | ||
api enforcedPlatform('org.springframework.boot:spring-boot-dependencies:2.1.3.RELEASE') | ||
|
||
// We may also define common dependencies here, but such usage is discouraged, use sparingly! | ||
//api 'org.projectlombok:lombok' | ||
|
||
constraints { | ||
// Constraint the version on those who like to consume Banana platform or BOM | ||
api 'com.sankholin.banana:banana-sim-core:1.1.0' | ||
api 'com.sankholin.banana:banana-domain:3.0.0-SNAPSHOT' | ||
api 'com.sankholin.banana:banana-service:3.0.0-SNAPSHOT' | ||
api 'com.sankholin.banana:banana-utils:3.0.0-SNAPSHOT' | ||
|
||
// It may also involve some external libraries, but do it sparingly! follows are just e.g. | ||
//api 'commons-httpclient:commons-httpclient:3.1' | ||
//api 'org.apache.commons:commons-lang3:3.8.1' | ||
//runtime 'org.postgresql:postgresql:42.2.5' | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
maven(MavenPublication) { | ||
from components.javaPlatform | ||
} | ||
publications { | ||
maven(MavenPublication) { from components.javaPlatform } | ||
} | ||
repositories { | ||
maven { | ||
def releasesRepoUrl = "$repoUrl/repository/maven-releases" | ||
def snapshotsRepoUrl = "$repoUrl/repository/maven-snapshots" | ||
url = project.hasProperty('release') ? releasesRepoUrl : snapshotsRepoUrl | ||
credentials { | ||
username "$repoUser" | ||
password "$repoPass" | ||
} | ||
} | ||
} | ||
} | ||
|
||
spotless { | ||
groovyGradle { | ||
target '*.gradle' | ||
greclipse() | ||
indentWithSpaces(2) | ||
trimTrailingWhitespace() | ||
endWithNewline() | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
07-platform-bom-build/gradle/banana-platform/gradle.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Should copy this file gradle.properties over ~/.gradle/gradle.properties | ||
repoUrl = http://repoUrl | ||
repoUser = repoUser | ||
repoPass = repoPass |
Oops, something went wrong.