title: Semver when adding values to enums
body: <p>We're introducing semantic versioning (<a href="http://semver.org/" rel="nofollow">http://semver.org/</a>) to our Java libraries.</p>
  
  <p>How should we handle adding new enum values? The situation we have is the following:</p>
  
  <ul>
  <li><code>annotations.jar</code> contains an annotation with has a property of type <code>MyEnum</code></li>
  <li><code>util.jar</code> has objects annotated using the annotated from <code>annotations.jar</code></li>
  <li><code>wsprovider.jar</code> uses a jaxb like technology to serialise the annotated objects from <code>util.jar</code> into a web api</li>
  <li><code>wsconsumer.jar</code> consumes the web api provided by <code>wsprovider.jar</code>, and does a switch based on the value of <code>MyEnum</code> to change it's behaviour.</li>
  </ul>
  
  <p>If we add a new value to <code>MyEnum</code>, which parts (major/minor/patch) of the various jars should we bump?</p>
  
  <p>It seems to me like <code>util.jar</code> needs to bump the major version, because the API changed in a way that can break existing code.</p>
  
  <p>By the same logic this would ripple through to a major bump in <code>wsprovider.jar</code> and <code>wsconsumer.jar</code>.</p>
  
  <p>Does <code>annotations.jar</code> need a major version bump?</p>
  
  <p>I would say yes because enums are a closed set of values, so code (such as <code>wsconsumer.jar</code>) make an assumption that by covering all values in the enum it covers all possible behaviours. Adding a new value to the enum then breaks that.</p>
  
  <p>However, instinctually it all seems a bit much for the addition of a single value to an enum, and has quite a knock-on effect.</p>
  
  <p>I guess this is just something we need to get used to with semver?</p>