Showing posts with label maven. Show all posts
Showing posts with label maven. Show all posts

Monday, 31 August 2009

Eclipse configuration

  • Configuration for Eclipse Galileo - M2Eclipse - Subversive
  • (M2Eclipse-0.9.9: http://m2eclipse.sonatype.org/releases/0.9.9.200906081351 )
  • Hibenate tools: http://download.jboss.org/jbosstools/updates/stable
  • eclEmma.org - Java code coverage for Eclipse: http://update.eclemma.org


To configure manually eclipse workspaces edit the file:
eclipse\configuration\.settings\org.eclipse.ui.ide.prefs

A simple way to create new Eclipse workspace with all your old settings is to copy this directory .metadata/.plugins/org.eclipse.core.runtime/.settings into your new workspace directory.

To configure static imports simply configure static import favorites on the
Window > Preferences > Java > Editor > Content Assist > Favorites preference page

Sunday, 10 May 2009

Struts2 web framework - Set up Struts2 with Maven

These are the minimum requirements to create a HelloWorld Struts application.

Here is the pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>eleannita</groupId>
<artifactId>blog</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>blog</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.9</version>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>2.1.6</version>
</dependency>
<dependency>
<groupId>com.opensymphony</groupId>
<artifactId>xwork</artifactId>
<version>2.1.2</version>
</dependency>
</dependencies>
</project>

You can now execute that using Jetty. It is an lightweight servlet container and you can easily run jetty using maven with the command:
mvn jetty:run
Voila! :)

Automate your build process with Maven

I like using Maven because it makes the build process easy. It is much more organized than Ant.With maven you know by default what is the project structure.

Maven: The Definite Guide is an excellent book that provides comprehensive documentation for Maven and also has example code. You can download it for free and even access it through eclipse.