6

Let's suppose we have a Maven project in Eclipse. The pom.xml has two profiles.

The question is: how can I run maven in Eclipse in order to execute every goals for each profile?

I tried to:

  • setting active maven profiles in Properties/Maven -> didn't work
  • run maven with: clean install -Pprofile1 -Pprofile2 -> didn't work
  • run maven with: clean install -P profile1,profile2 -> didn't work
  • run maven setting "Profiles" under "Goals" ( profile1,profile2) -> didn't work

I want that maven will run for both profiles, executing all tasks in the pom.xml

Thanks.

Alessandro C
  • 3,310
  • 9
  • 46
  • 82
  • What is the purpose of those profiles? What are the differences? – khmarbaise Oct 26 '18 at 07:53
  • The purpose is: run a build with both profiles. The build itself makes different things on each profile. I simply want to run the build one single time with both profiles and combine the result of the build of profile1 with the build of the profile2 – Alessandro C Oct 26 '18 at 12:39
  • sorry but your answer you have written does not answer my question. What is being done for the different profiles? Why are those profiles needed? – khmarbaise Oct 26 '18 at 12:42
  • That's not relevant what the build has to do. I simply want to know how can I have in the target folder the result of the build with profile1 with the build of the profile2. Each build produces a "profile1" or "profile2" folder in target. So I want to produce both in the same time. – Alessandro C Oct 26 '18 at 12:47
  • What do you exactly get, if you specify all profiles in the Maven run configuration? As a workaround, the Maven run configurations for the different profiles can be combined in a _Launch Group_: https://stackoverflow.com/a/47302032/6505250 – howlger Oct 27 '18 at 13:35
  • If I specify all the profiles, only one is built. The _Launch Group_ function looks interesting. – Alessandro C Oct 29 '18 at 16:05

1 Answers1

0

Here is how you do it Eclipse Config