title: Maven builds and dependency injection using Spring
body: <p>I have a Java application that is managed using Maven. The project involves the concepts of countries that doSomething e.g.</p>
  
  <pre class="lang-java prettyprint-override"><code>public interface ICountry {
      public void doSomething();
  }
  
  public class England implements ICountry {...}
  public class Brazil  implements ICountry {...}
  
  public class CountryApp {
      public static void main (String args[]) {
  
          ICountry country = null;
  
          // PSEUDOCODE:
          // Retrieve a chosen implementation of ICountry using Spring
  
          country.doSomething();
      }
  }
  </code></pre>
  
  <p>From what I've seen of <a href="http://www.vogella.de/articles/SpringDependencyInjection/article.html#usageannotations" rel="nofollow">Spring</a> I could potentially have one Spring configuration file for each country. It looks possible to use <a href="http://maven.apache.org/guides/introduction/introduction-to-profiles.html" rel="nofollow">Maven profiles</a> to select the appropriate configuration file using the  element within the profile. However the documentation says profiles are intended for supporting building on different environments rather than having different configurations of the application.</p>
  
  <p>Does this sound like a reasonable approach? If someone knows of a better or "more standard" way please let me know :)</p>
  
  <p><strong>EDIT:</strong> Ultimately I'd like to be able to create a .jar for each country. e.g. </p>
  
  <ul>
  <li>myapp-england.jar,</li>
  <li>myapp-brazil.jar, etc</li>
  </ul>