Jenkins Gradle Plugin - Pass parameters as -P instead of -D

Jenkins Gradle Plugin - Pass parameters as -P instead of -D

By : MrBearington
Date : November 22 2020, 10:38 AM
wish help you to fix your issue I guess at this time, there is no way to tell Gradle plugin in Jenkins to NOT pass the parameters (defined in Jenkins job) as -Dxxx=$yyy way (which it's doing for us for free).
We can though, use "switches" box/option to specify these parameters as -P way but it's little confusing how -D parameters will impact the JVM which Gradle uses to run itself and whether -D parameters will somehow clash with -P parameters (as they are getting passed / defined twice).
code :

Share : facebook icon twitter icon
How to pass a system property to gradle with the jenkins gradle plugin?

How to pass a system property to gradle with the jenkins gradle plugin?

By : santiago
Date : March 29 2020, 07:55 AM
will help you Use -Pmyprop instead of -Dmyprop.
The Gradle Jenkins Plugin accepts parameters with -P.
Pass in arguments from Jenkins to Gradle plugin

Pass in arguments from Jenkins to Gradle plugin

By : LeAnn Du
Date : March 29 2020, 07:55 AM
it should still fix some issue Gradle seem to call these 'switches' which there is indeed an option for.
Pass dynamic parameters to Gradle Jenkins plugin

Pass dynamic parameters to Gradle Jenkins plugin

By : John Steed
Date : March 29 2020, 07:55 AM
Any of those help When Jenkins passes the parameters to Gradle, they are set as Systems Properties. The task now is to parse the "-DoptionalParam1=value1 -DOptionalParam2=value2" passed as an "Additional Parameters" and then pass these further to the Java application as JVM paramters. Below is the Gralde code snippet that does it. To simplify the "Additional Paramter" is passed as "optionalParam1=value1 OptionalParam2=value2", ie without the -D syntax.
code :
    task runJavaApp(type: JavaExec, dependsOn: build) {

        def jvmParams = []
        if (it.key!="Additional Parameters") {
            jvmParams <<  "-D${it.key}=${it.value}"
        } else {
            def tokens = (it.value).split(/\s{1,}/)
            tokens.each {
                def key, value
                if (it.split('=').length == 2)
                    (key, value )= it.split('=')
                    throw new Exception("'${it}' should be of type key=value");
                jvmParams <<  "-D${key}=${value}"
        jvmArgs jvmParams
        workingDir = project.executeDir
        classpath = sourceSets.main.runtimeClasspath + files(project.executeDir)
        main = 'myApplicaionMainClass'
jenkins Parameterized Trigger Plugin doesn't pass parameters downstream

jenkins Parameterized Trigger Plugin doesn't pass parameters downstream

By : Александр Рягузов
Date : March 29 2020, 07:55 AM
To fix this issue In the dropdown "Add Parameters" just use "Current build parameters". This will pass all previously defined parameters to the next step. (Only those you added via Jenkins, not those you added in a batch script!)
Also there is in the same dropdown the option "Parameters from properties file" which in your case sounds like the better fit
How to pass parameters to parallel process using pipeline plugin in jenkins

How to pass parameters to parallel process using pipeline plugin in jenkins

By : user6620412
Date : March 29 2020, 07:55 AM
I hope this helps you . The pipeline in your question doesn't seem to match your description, as java jar TitanRead.jar won't work; you'd need to use -jar.
In any case, your sh script parameter should be using a double-quoted string, otherwise $inputNum won't be evaluated, i.e.:
code :
sh script: "java -jar TitanRead.jar ${inputNum}"
Related Posts Related Posts :
  • No address associated with hostname using vagrant
  • 2 way data-binding between a polymer component and a model?
  • How can I rename an already published app in the Windows Dev Center?
  • Using Chef 12 , Chef Client unable to connect to chef Server
  • GCM notification not working (GoogleCloudMessaging)
  • Measured GFLOPS is greater then theoretical GFLOPS
  • Progress ABL - strip and add to temp table
  • Errors occuring when make-ing Aircrack-ng on raspberry pi
  • Detecting Handedness from Device Use
  • Query a manual list of data items
  • Similar to pivot - Windows 8.1 Desktop app
  • CKEDITOR And Styles configuration with only toolbar
  • Segmentation fault due to data alignment issue on MIC
  • how to connect a Java app ( java code ) to cloudant?
  • How to download a file/folder from remote (openshift) to local system
  • Where can i find customeditors in JBPM 6
  • Pig get distinct rows with counts
  • In Flex when is yylineno updated?
  • How does a semantic reasoner for protegé is made?
  • how to stop another rows to be select after select a row in uitableview
  • Setup cmd.exe parameter when starting ConEmu
  • WPF how to get the same visual size in different devices
  • How to convert tiff to searchable pdf using alfresco and tesseact?
  • Intel Media SDK: Regarding mfxIMPL Usage
  • How to pass values to SOAP service using web service consumer?
  • Post image base64 from iOS to twitter using request.js
  • I have installed chef server, client version 12.0.1 and 12.0.3 respectively but unable to authenticate to chef server
  • Minifying and publishing CSS and JavaScript using Visual Studio 2013 and LESS
  • Can't deploy kitchensink example
  • Facing issue in mule testing
  • db2 explain result about lock size
  • Make Firebug NOT autocomplete
  • Blank Space at bottom of Polymer Paper Dialog
  • How do you initialize application state at startup and access it from controllers in MVC 6?
  • can you help when to use field and when to use parameter and variable in jasper?
  • What are Talend change data capture's pluses and deltas in a production EAI+big data integration scenario?
  • Tree traversal in Rust vs Borrow Checker
  • how sensiya SDK distinct motion sitting and driving?
  • Test Dropbox webhooks implementation with self-signed certificate?
  • Custom axis labels for Core Plot
  • Using CLLocationManager in SpringBoard, but got the error with:depending on legacy on-demand authorization, which is not
  • retrieving selected documents in couchdb
  • How to unroll client side bundle
  • Why JPanel doesn't have all the lines in my app?
  • make ctrl+enter add semicolon to the end of the line
  • How to test low-bit ambient and burn-in protection when making watch faces?
  • What is causing this error in changing the default music font in a Lilypond document?
  • Using environment variables in POST payload
  • Use a custom helper in Middleman Frontmatter
  • LinkedIn r_basicprofile and r_fullprofile scope fields and why are both "redundant"?
  • Disconnecting 2 vertical "lines" with glDrawArrays GL_TRIANGLE_STRIP
  • Slow apigee query when using geolocation with wildcard search
  • Allocator replacement check
  • Javafx 8 how to make mouse cursor invisible?
  • Can you use OpenID Connect without obtaining OAuth credentials?
  • Appium send_keys overwritting previous text
  • Where do I find my google places 'place_id'?
  • Parse.com Stripe: Creating a charge that is not captured
  • Custom Vibe sequence in Pebble.js?
  • reuse property in my own owl ontology but change domain/range
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org