Answers: <p>I'm not an expert on this, but maintaining separate pom files seems like a recipe for things to get out of sync.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-06-27T19:40:17.920Z
Answers: 2017-06-27T19:40:17.920Z
Answers: maplebird
Body: <p>Imagine that a Maven POM configures a set of integration tests for web apps (could be a functional test as well). </p>
  
  <ul>
  <li>in developer context, you would clearly use Chrome and configure that accordingly</li>
  <li>in the CI, you want a headless test with another browser driver</li>
  </ul>
  
  <p>Same would be if you decide to configure all fixed dependencies' versions in on place, and for a specific stage/release.</p>
  
  <p>For such cases, what is the best strategy to have environment-specific POM properties files for Maven, and is it a good approach?</p>
  
Tags: <continuous-integration><automation><maven>
Title: Different execution contexts for same POM - use properties files?
UserDisplayName: Ta Mu
ThreadText: # Different execution contexts for same POM - use properties files?
  
  (Asked by: username_0 on 2017-06-27)
  
  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?
  
  **Tags:** continuous-integration, automation, maven
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-27. Score: 1 | Accepted answer
  
  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.
  
  
  ---
  
  