You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi,
I have a bamoo build plan in which I added a maven task. In Goal I wrote
package -P prod-profile
But the artifact generated (jar file) is created with the default profile configurations, as it seems that the -P above is ignored.
Is there anything wrong in my entry?
I appreciate your support and look forward to hear from you.
Thanks a lot and best regards
Regards
Rasha Elsayed
Hello @Rasha Elsayed
Welcome to Atlassian Community!
Check the pom.xml file for any activeByDefault set to false. Maven will only consider it if it is active.
Running mvn help:active-profiles will show the active profiles.
You also need to understand that the profile configuration needs to be carried on by the Project's pom.xml file. Or, you will have to replicate the profile configuration in one of the Agent's own locations (outside of the build scope):
Best regards,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
Hello Eduardo,
thanks a lot for your reply. Actually I have 2 profiles:
Running mvn package -P prod-profile from the command line on my local machine works correctly. The jar artifact is generated with the prod-profile configurations.
However in bamboo mvn task, when I enter package -P prod-profile in the Goal field, the jar file gets generated with the dev-profile configurations.
In addition, from command line
So, it seems that the Maven task in bamboo ignores the -P setting in the goal, right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Rasha Elsayed
You should set activeByDefault on prod-profile in pom.xml so mvn would consider it. That's validated when you run the help:active-profiles command.
Your local machine or the Agent may have other Maven settings that may be considering/not considering that profile.
Thank you,
Eduardo Alvarenga
Atlassian Support APAC
--please don't forget to Accept the answer if the reply is helpful--
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your Response. I think i will replace the maven task with a script task in which i can run maven simply as
mvn package -P prod-profile
Regards
Rasha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.