Get inherited groupId with readMavenPom The Next CEO of Stack OverflowDuplicate artifactId in child pomPassing properties present in <parent> tag via command lineMaven reuse properties from Super POMhow to specify final jar file name from command line in multi module environmentJenkins job failing because of incorrect parent child pom.xml entriesjenkins get environment variable pom properties nullsHow do pipeline parameters and jenkins GUI parameters work together?Accessing parent POM properties from JenkinsfileWhat will be the groupId for the dependencies used inside the pom if there is no variable specified in properties?Jenkins Artifactory Plugin + Maven Flatten plugin + rtMavenDeployer. Is there a way to deploy flatten pom files?

How did people program for Consoles with multiple CPUs?

Rotate a column

What was the first Unix version to run on a microcomputer?

If the heap is initialized for security, then why is the stack uninitialized?

Would a galaxy be visible from outside, but nearby?

Won the lottery - how do I keep the money?

WOW air has ceased operation, can I get my tickets refunded?

Why don't programming languages automatically manage the synchronous/asynchronous problem?

Received an invoice from my ex-employer billing me for training; how to handle?

Why am I allowed to create multiple unique pointers from a single object?

Why has the US not been more assertive in confronting Russia in recent years?

I believe this to be a fraud - hired, then asked to cash check and send cash as Bitcoin

In excess I'm lethal

Anatomically Correct Strange Women In Ponds Distributing Swords

Return the Closest Prime Number

How to prevent changing the value of variable?

Why is the US ranked as #45 in Press Freedom ratings, despite its extremely permissive free speech laws?

Multiple labels for a single equation

Why do professional authors make "consistency" mistakes? And how to avoid them?

Is it ever safe to open a suspicious html file (e.g. email attachment)?

Novel about a guy who is possessed by the divine essence and the world ends?

Do I need to enable Dev Hub in my PROD Org?

Which kind of appliances can one connect to electric sockets located in an airplane's toilet?

What happened in Rome, when the western empire "fell"?



Get inherited groupId with readMavenPom



The Next CEO of Stack OverflowDuplicate artifactId in child pomPassing properties present in <parent> tag via command lineMaven reuse properties from Super POMhow to specify final jar file name from command line in multi module environmentJenkins job failing because of incorrect parent child pom.xml entriesjenkins get environment variable pom properties nullsHow do pipeline parameters and jenkins GUI parameters work together?Accessing parent POM properties from JenkinsfileWhat will be the groupId for the dependencies used inside the pom if there is no variable specified in properties?Jenkins Artifactory Plugin + Maven Flatten plugin + rtMavenDeployer. Is there a way to deploy flatten pom files?










3















I have a question concerning readMavenPom (Link to doc) utility from Jenkins pipelines.



I have a project with a pom.xml where no groupId is defined but this pom.xml has a parent pom with a a defined groupId. (It could happen that, even this parent doesn't have a defined groupId and is the parent.parent the one that has it).



Is there a way to get the, let's say, effective groupId in an elegant way?



I'm currently getting null with the getGroupId() method (or property accessor .groupId)



NOTE: With elegant way I mean, not looping into parents and checking if groupId is not null.



Thanks in advance.










share|improve this question






















  • Hi, what do you need the groupId for?

    – hakamairi
    Mar 8 at 8:32















3















I have a question concerning readMavenPom (Link to doc) utility from Jenkins pipelines.



I have a project with a pom.xml where no groupId is defined but this pom.xml has a parent pom with a a defined groupId. (It could happen that, even this parent doesn't have a defined groupId and is the parent.parent the one that has it).



Is there a way to get the, let's say, effective groupId in an elegant way?



I'm currently getting null with the getGroupId() method (or property accessor .groupId)



NOTE: With elegant way I mean, not looping into parents and checking if groupId is not null.



Thanks in advance.










share|improve this question






















  • Hi, what do you need the groupId for?

    – hakamairi
    Mar 8 at 8:32













3












3








3


1






I have a question concerning readMavenPom (Link to doc) utility from Jenkins pipelines.



I have a project with a pom.xml where no groupId is defined but this pom.xml has a parent pom with a a defined groupId. (It could happen that, even this parent doesn't have a defined groupId and is the parent.parent the one that has it).



Is there a way to get the, let's say, effective groupId in an elegant way?



I'm currently getting null with the getGroupId() method (or property accessor .groupId)



NOTE: With elegant way I mean, not looping into parents and checking if groupId is not null.



Thanks in advance.










share|improve this question














I have a question concerning readMavenPom (Link to doc) utility from Jenkins pipelines.



I have a project with a pom.xml where no groupId is defined but this pom.xml has a parent pom with a a defined groupId. (It could happen that, even this parent doesn't have a defined groupId and is the parent.parent the one that has it).



Is there a way to get the, let's say, effective groupId in an elegant way?



I'm currently getting null with the getGroupId() method (or property accessor .groupId)



NOTE: With elegant way I mean, not looping into parents and checking if groupId is not null.



Thanks in advance.







maven jenkins jenkins-pipeline pom.xml






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 7 at 15:03









dcalapdcalap

536725




536725












  • Hi, what do you need the groupId for?

    – hakamairi
    Mar 8 at 8:32

















  • Hi, what do you need the groupId for?

    – hakamairi
    Mar 8 at 8:32
















Hi, what do you need the groupId for?

– hakamairi
Mar 8 at 8:32





Hi, what do you need the groupId for?

– hakamairi
Mar 8 at 8:32












2 Answers
2






active

oldest

votes


















0














You need te got the effective-pom and get the groupid from there. The effective pom is the result after all dependencies and inheritance variables have been resolved, giving you a perfect overview of what will end up in your package.
doc.: https://maven.apache.org/plugins/maven-help-plugin/effective-pom-mojo.html






share|improve this answer






























    0














    You could simply use the maven-help-plugin:evaluate goal via command line which can give you what you need.



    The following will exactly extract the groupId of the project and will handle all the things based on your inheritance part.



    mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout


    This could be done in a separate stage step of the Jenkins Pipeline.






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55046895%2fget-inherited-groupid-with-readmavenpom%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      You need te got the effective-pom and get the groupid from there. The effective pom is the result after all dependencies and inheritance variables have been resolved, giving you a perfect overview of what will end up in your package.
      doc.: https://maven.apache.org/plugins/maven-help-plugin/effective-pom-mojo.html






      share|improve this answer



























        0














        You need te got the effective-pom and get the groupid from there. The effective pom is the result after all dependencies and inheritance variables have been resolved, giving you a perfect overview of what will end up in your package.
        doc.: https://maven.apache.org/plugins/maven-help-plugin/effective-pom-mojo.html






        share|improve this answer

























          0












          0








          0







          You need te got the effective-pom and get the groupid from there. The effective pom is the result after all dependencies and inheritance variables have been resolved, giving you a perfect overview of what will end up in your package.
          doc.: https://maven.apache.org/plugins/maven-help-plugin/effective-pom-mojo.html






          share|improve this answer













          You need te got the effective-pom and get the groupid from there. The effective pom is the result after all dependencies and inheritance variables have been resolved, giving you a perfect overview of what will end up in your package.
          doc.: https://maven.apache.org/plugins/maven-help-plugin/effective-pom-mojo.html







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 8 at 8:33









          fl0wfl0w

          1,1981319




          1,1981319























              0














              You could simply use the maven-help-plugin:evaluate goal via command line which can give you what you need.



              The following will exactly extract the groupId of the project and will handle all the things based on your inheritance part.



              mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout


              This could be done in a separate stage step of the Jenkins Pipeline.






              share|improve this answer



























                0














                You could simply use the maven-help-plugin:evaluate goal via command line which can give you what you need.



                The following will exactly extract the groupId of the project and will handle all the things based on your inheritance part.



                mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout


                This could be done in a separate stage step of the Jenkins Pipeline.






                share|improve this answer

























                  0












                  0








                  0







                  You could simply use the maven-help-plugin:evaluate goal via command line which can give you what you need.



                  The following will exactly extract the groupId of the project and will handle all the things based on your inheritance part.



                  mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout


                  This could be done in a separate stage step of the Jenkins Pipeline.






                  share|improve this answer













                  You could simply use the maven-help-plugin:evaluate goal via command line which can give you what you need.



                  The following will exactly extract the groupId of the project and will handle all the things based on your inheritance part.



                  mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout


                  This could be done in a separate stage step of the Jenkins Pipeline.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 8 at 17:23









                  khmarbaisekhmarbaise

                  65.9k18127166




                  65.9k18127166



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55046895%2fget-inherited-groupid-with-readmavenpom%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                      Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                      Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved