title: Do I need to include Java EE maven dependencies in POM.xml if I develop my application against Glassfish?
body: <p>I am developing a Java EE application and I intend to run it on an Java EE Application Server (I have chosen Glassfish). </p>
  
  <p>I know Glassfish is a reference implementation (RI) of the Java EE platform and it implements/contains individual reference implementations of the Java EE specifications. Correct me if i'm wrong but this leads me to understand that the binaries of Glassfish will contain all the relevant RIs jars inside it.</p>
  
  <p>I am using Maven as my build/project management system and I will build/package my application up in a WAR file (because my application is a Java EE web application). Then I will deploy this WAR onto my Application Server - Glassfish and then it runs.</p>
  
  <p>My question is, do I need to specify the Java EE dependencies in my Maven pom.xml file?</p>
  
  <p>I'm using Eclipse as my IDE and at the moment I need to include those dependencies otherwise Eclipse will not recognise the Java EE sources - it will complain with compile time errors.</p>
  
  <p>But if I do include in my pom.xml then does that not mean I'm duplicating the external dependencies (Java EE RI jars) in my application (in the WAR file) whereas an Application Server like Glassfish already provides it? because Maven downloads those jars and put into your code base - right?</p>
  
  <p>for.eg (just using JMS as an example):</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;javax.jms&lt;/groupId&gt;
      &lt;artifactId&gt;javax.jms-api&lt;/artifactId&gt;
      &lt;version&gt;2.0.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>do I need above? I know I definitely do if I were developing against Tomcat because it is a Servlet container and doesn't have the other full Java EE specifications.</p>
  
  <ul>
  <li>this is the part where I'm a bit confused about and I hope someone will shed a light on this. </li>
  </ul>