In this section we'll get started creating the back-end of the to-do list sample application. First, open a command line in the todolist directory that we created in Part 1 of the series and run the following command:
mvn archetype:create \ -DgroupId=org.epseelon.samples \ -DartifactId=todolist-web \ -DarchetypeArtifactId=maven-archetype-webapp
The command above creates a new todolist submodule inside the root todolist module. Next, edit the POM of this newly created module to add the following dependencies:
<dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> <version>2.5.2</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.5.4</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.5.4</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.2.6.ga</version> </dependency>
The dependencies added above are required for Spring and Hibernate to work.
Last but not least, update the configuration of the Java compiler plug-in in this module so that we can use generics and annotations in our code. Add the following plug-in configuration to the project/build/plugins node:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
At this point we've set up the module for the back-end, to prepare it for development. In the next section, we'll build the interface for the to-do list service using Java.