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.