title: How to add the common annotations API dependency in a Maven Pom.xml file?
body: <p>I have been trying to add this to my POM file which is what is in an example POM file for a hello world program:</p>
  
  <pre><code>&lt;!-- Import the Common Annotations API (JSR-250), we use provided scope 
       as the API is included in JBoss AS 7 --&gt;
    &lt;dependency&gt;
       &lt;groupId&gt;org.jboss.spec.javax.annotation&lt;/groupId&gt;
       &lt;artifactId&gt;jboss-annotations-api_1.1_spec&lt;/artifactId&gt;
       &lt;scope&gt;provided&lt;/scope&gt;
    &lt;/dependency&gt;
  </code></pre>
  
  <p>When I run it, it fails. It says the version number is missing. When I add a version, say 1.0, it still fails. I am pretty new to POM files and maven, so any explanation would be helpful.</p>
  
  <p>My POM file:</p>
  
  <pre><code>    &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;com.unihub.app&lt;/groupId&gt;
    &lt;artifactId&gt;unihub&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;unihub&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  &lt;!--Import the Servlet API using provided scope as the JARs are already included in Jboss7--&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
          &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
          &lt;version&gt;2.4&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
       &lt;build&gt;
        &lt;!-- Set the name of the war, used as the context root when the app 
           is deployed --&gt;
        &lt;finalName&gt;unihub&lt;/finalName&gt;
        &lt;plugins&gt;
                 &lt;plugin&gt;
              &lt;groupId&gt;org.jboss.as.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;jboss-as-maven-plugin&lt;/artifactId&gt;
              &lt;version&gt;7.3.Final&lt;/version&gt;
           &lt;/plugin&gt;
          &lt;plugin&gt;
            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.3.1&lt;/version&gt;
            &lt;configuration&gt;
              &lt;source&gt;1.6&lt;/source&gt;
              &lt;target&gt;1.6&lt;/target&gt;
            &lt;/configuration&gt;
          &lt;/plugin&gt;
         &lt;/plugins&gt;
     &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>