There are a lot of resources around for maven. Then why this blog item? Well actually because I want to capture what I do, if someone can use it along the way it would be nice. Therefore this blog item is here. This item describes the merging of my student sample application into a maven project.
First steps for maven:
- start reading the Maven Getting Started Guide
- Choose an archetype – These are a sort of project templates that come with maven and can be made company specific. In my case I want to create a web application, there is a mini guideline for webapplications
mvn archetype:create -DgroupId=nl.gridshore.registrations -DartifactId=registrations-webapp -DarchetypeArtifactId=maven-archetype-webapp
In short : download the classes from the sun site and issue the following command
mvn install:install-file -Dfile=./jta-1_0_1B-classes.zip -DgroupId=javax.transaction -DartifactId=jta -Dversion=1.0.1B -Dpackaging=jar
mvn install:install-file -Dfile=activation.jar -DgroupId=javax.activation -DartifactId=activation -Dversion=1.0.2 -Dpackaging=jar mvn install:install-file -Dfile=mail.jar -DgroupId=javax.mail -DartifactId=mail -Dversion=1.3.2 -Dpackaging=jar mvn install:install-file -Dfile=connector.jar -DgroupId=javax.resource -DartifactId=connector -Dversion=1.0 -Dpackaging=jar
mvn package
Now we have a war file that we can deploy, I did not test it yet. I do have some more issues to figure out. While creating the war file, all libraries are copied to web-inf/lib, also all dependencies. Therefore I now have spring.jar and all components jars like spring-core, spring-aop, etc as well. So double jars, to much memory, etc.
Lets move on and try to get the maven site up and running.
- First try, just generate the site. This gives you the skeleton of the website, but almost no reports yet. You can have a look at your dependencies, nice.
mvn site
I must add versioning and maybe some other parts as well, but for now it is enough. In the near future I want to do more with the libraries, I do not want double spring jars etc, and I want to keep foolowing the reports. These reports are not working correct at the moment en they must be improved.