Associating different maven profiles for different run/debug configuration

Hi,

I have maven projects where JUnit tests need to run a maven build ( due to code generation XJC, etc ) before running the test case.

Is there a way to activate different sets of profiles when doing a "Before Run" for different unit tests ?

I mean I want to remove the default "Make" before Launch and add a maven build, but my builds are dependent on some active profiles.

So can I associate an active profile for each "Before Launch" configuration section.

Thanks

2 comments
Comment actions Permalink

I do not know of a way to do what you want in IDEA 11, other than to make some profiles the default and then deactivate them for other builds. In IDEA 12 (currently in EAP beta) however, there is a way to accomplish what you want. They have greatly improved the "Before launch" options in IDEA 12. You are now able to specify another run/debug configuration in the "Launch before" section. You can also define multiple "before launch" options of the same type or different types, and define the order. So what you could do in IDEA 12 is define the Maven build, with its needed profile, as  another run/debug configuration. Then have your test run that as the  "Before Launch" option.

screenshot1.png
screenshot2.png

0
Comment actions Permalink

Hi,

Thanks for the suggestion. The work around is suitable for my purposes

0

Please sign in to leave a comment.