Issue
I made a new Maven project with Netbeans. There is a pom.xml
in which i added:
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.4.RELEASE</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.3.24</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.1.0.Final</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
Is it normal if I don't have a web.xml in my project tree after building the project or should i treat the glassfish.xml just the same ?
I wonder if I didn't messed up things.
Solution
Java EE 6 made web.xml optional (traded in for a bunch of annotation-based configurations). If maven knows that Java EE 6 is the version, then it won't complain about a missing web.xml.
You should be able to configure for the most part using annotations. For portability's sake, use web.xml IF NEEDED rather than relying on vendor-specific configuration files.
Answered By - ernest_k
Answer Checked By - Willingham (JavaFixing Volunteer)