Imagine that a Maven POM configures a set of integration tests for web apps (could be a functional test as well).

  • in developer context, you would clearly use Chrome and configure that accordingly
  • in the CI, you want a headless test with another browser driver

Same would be if you decide to configure all fixed dependencies' versions in on place, and for a specific stage/release.

For such cases, what is the best strategy to have environment-specific POM properties files for Maven, and is it a good approach?

1 Answer 1


I'm not an expert on this, but maintaining separate pom files seems like a recipe for things to get out of sync.

It would make more sense to define specific dependencies within the same pom.xml and execute them depending on specific goals or targets. I.e. -Pdev.

You could also then define a list of shared dependencies used by all targets (i.e. chrome driver or what not), and specific dependencies for each target.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.