Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bamboo YAML use a plugin like Bamboo Maven POM Value Extractor

Hi all!

I am very excited to test the new bamboo.yml feature and I am already able to use maven and build our docker containers

but I need a plugin or script to extract pom values for the deployment (in my case $bamboo_maven_version)

any ideas to to achieve that?

thanks in advance!

 

 

1 answer

In terms of plugins, you might want to check out David Ehringer's excellent Maven POM Value Extractor, which "Extracts values from Maven POMs and keep your Bamboo variables in sync with your Maven POM", thus precisely addresses your requirements!

Given the latest version is from 2016, it cannot have built-in Bamboo Specs (Java) yet, which can be worked around with the AnyTask class, as outlined in Configuring unsupported tasks.

That being said, Bamboo Specs (YAML) does not yet support tasks and is mostly script focused as of today. You need to resort to a script based approach for variable extraction from Maven's XML based POM accordingly. I do not have a solution handy, but depending on your script environment, there should be several options to extract the value (possibly via XPath/XSLT), for example:

PowerShell

Bash

Thank you! Yes I already use the plugin. But am I able to use it out of the "new" Bamboo YAML specs

 

https://docs.atlassian.com/bamboo-specs-docs/6.3.0/specs-yaml.html

 

example:

---
project:
  key: DRAGON
  plan:
    key: SLAYER
    name: Dragon Slayer Quest
stages:
  - jobs:
      - scripts:
          - M2_HOME=${bamboo_capability_system_builder_mvn3_Maven_3}
          - ${bamboo_capability_system_builder_mvn3_Maven_3}/bin/mvn clean install
        requirements:
            - system.builder.mvn3.Maven 3
            - linux
        artifacts:
          - name: library
            path: target/*.jar
        testParsers:
          - junit

 

Bamboo YAML Specs allow only for using plain scripts. You can't use any task builders. 

I think the only way who to achieve what you want is to run "grep" and get the values you need. 

Thanks for the clarification @Mathias Gebbe, I've misread your question indeed. As Grzegorz already pointed out, other than Bamboo Specs (Java), Bamboo Specs (YAML) do not yet support tasks - given Maven's POM is XML based, I've updated my answer with a few pointers how you might achieve this via Xpath/XSLT.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

251 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you