Unable to give command line parameters during build
See original GitHub issueEnvironment: Local
- *Jib version: 2.1.0
- Build tool: Gradle 5.4.1
- OS: Windows
Description of the issue: I am having conditional based build to make normal spring boot jar with Netflix stack and application jar with Kubernetes stack.
Expected behavior: When I use the Gradle build with -Dk8s=true then the application jar will consist of Kubernetes stack. If the parameters not used while building then normal Netflix stack will be in the application jar
Steps to reproduce:
- Add the following command to build.gradle
if (System.getProperty("k8s") == "true") {
dependencies {
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-kubernetes', version: '1.0.3.RELEASE'
compile group: 'org.springframework.cloud', name: 'spring-cloud-context', version: '2.1.1.RELEASE'
compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-kubernetes-config', version: '1.0.3.RELEASE'
}
configurations {
compile.exclude group: "org.springframework.cloud", module: "spring-cloud-netflix-core"
}
}
- Do the docker image build with
./gradlew jibDockerBuild -Dk8s=true
- Run the image in docker it should use the Kubernetes stack and not the Netflix stack
Log output:
Additional Information:
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Application is unable to get command argument - Stack Overflow
I'm unable to get command line argument with int main(int argc, char* argv[]) , No errors occurs but when further manipulation want to...
Read more >Unable to add custom Unity command-line parameters #124
My build process utilizes command-line parameters that are different from the built-in parameters. For example, I use a custom parameter to pass in...
Read more >Common Problems | TeamCity On-Premises Documentation
If the build succeeds from the console but still fails in TeamCity, use a command line runner in TeamCity to launch the same...
Read more >Command-line parameter examples for Visual Studio installation
To illustrate how to use command-line parameters to install Visual Studio, here are several examples that you can customize to match your ...
Read more >Can't use the CMake Integration for building from the ...
Hello, is there a way to build a CMake-based project with an appropriate CMakeSettings.json from the command line? I couldn't find any, e.g....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@loosebazooka Thanks for your guidance. The dive tool helped me a lot to figure out what went wrong. I missed JVM flag
-Dspring.profiles.active=k8s
for spring profile in the build.gradle file. Now it’s working fine as expected.@tamizharasanr In order to test this, I need a completely working build.gradle. It appears the code snippet you provided us with is missing bom references and other versioning information. Please provide more info to help us proceed.