Maven Conditional Build Section with Profile?

I am building a Flex application with Maven and the Flex Mojos plugin. Now I want to compile an alternative version of the application with some additional libraries to enable automatic functional testing. For this I need to change 2 things in pom:

  • additional dependencies
  • additional configuration of the Flex Mojos plugin in the build section

I created a profile in pom, configured to create an alternative version, and added additional dependencies. However, I am wondering how I can specify the optional Flex Mojos plugin configuration in the build section.

Should I just override (copy and modify) the complete plugin configuration from the build section to my profile or is there another way to do this?

+3
source share
1 answer

Yes, copy the plugin configuration to your profile. Define new dependencies as well. Shared configuration values ​​between two plugin configurations for the same plugin can be delegated to the common properties that you define in the pom element <properties>to allow setting values ​​in a common place.

+1
source

Source: https://habr.com/ru/post/1728589/


All Articles