I am developing a Java EE application and I intend to run it on an Java EE Application Server (I have chosen Glassfish).
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.
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.
My question is, do I need to specify the Java EE dependencies in my Maven pom.xml file?
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.
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?
for.eg (just using JMS as an example):
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<version>2.0.1</version>
</dependency>
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.
- this is the part where I'm a bit confused about and I hope someone will shed a light on this.
Aucun commentaire:
Enregistrer un commentaire