Wednesday December 10, 2008 12:00PM W92-106A Back Bay
Our December meeting was Maven 2 workshop during which we Maven-ized a simple Web application. Follow these steps to try it out for yourself. If you see any issues with these steps you can mention it on the JUG mailing list.
- Download the Maven2Sample-pre-maven.zip file. Unzip it and look at the contents.
- Run 'mvn archetype:generate' and choose 'internal -> maven-archetype-webapp (A simple Java web application)' to generate a Maven project. By default this would be number 18 from the menu. Enter the groupId 'edu.mit.jug' and the artifactId 'Maven2Sample' and then accept the defaults.
- Go into the Maven2Sample/src/main directory and run 'mkdir -p java/edu/mit/jug/' to create your source directories.
- Copy index.jsp from the pre-maven project into your new project's src/main/webapp/ directory.
- Copy web.xml from the pre-maven project into your new projects src/main/webapp/WEB-INF/ directory.
- Copy Maven2Sample.java from the pre-maven project into your new projects src/main/java/edu/mit/jug/ directory.
- Download the pom.xml file above and put it into the top level directory of your new project (overwrite the existing pom.xml).
- Run 'mvn package' -- and see that it fails because it can't find the itext JAR file. Download the itext-1.1.jar file and then run 'mvn install:install-file -DgroupId=com.lowagie -DartifactId=itext -Dversion=1.1 -Dpackaging=jar -Dfile=/path/to/jar' (with the correct path). You should then see "BUILD SUCCESSFUL."
- Find the Maven2Sample.war file in the target directory and deploy it to Tomcat. It should run! Good luck.
See the pre-meeting notes below for details about prerequisites, etc.
Pre-Meeting Notes
For our December meeting, we will be having a Maven 2 workshop. The plan is take a very simple Web application project and build it using Maven 2. Participants are encouraged to bring a laptop, download the files, and follow along. The goal is to give people the basic information they need to start using Maven 2 in a hands-on way.
...
- Maven2Sample-pre-maven.zip
- pom.xml
- Maven2Sample.zip
- itext-1.1.jar
- maven-dev-repository.txt
- maven2-before-after.png
...