Thursday, September 18, 2014

Maven with Eclipse Dynamic Web Project

First, I created a Dynamic Web Project in Eclipse, but I deleted the source folder "src", and replaced it with the Maven structure of "src/main/java" and "src/test/java".


Then, I Mavenized the project by right-clicking on the project, then on the context menu navigating to Configure → Convert to Maven Project.


Afterwards, I added the following dependencies to the pom.xml:

<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<version>4.11</version>
</dependency>
</dependencies>

And that's it. Worked liked a charm. 

I'm using Eclipse Java EE Luna.

No comments:

Post a Comment