Simply use maven with Sakarum Webapp Archetype to build your project
mvn archetype:generate -DgroupId=com.mycompany -DartifactId=myapp -DarchetypeGroupId=net.sourceforge.sakarum -DarchetypeArtifactId=sakarum-webapp-archetype -DarchetypeVersion=0.1.0.Alpha-SNAPSHOT -DarchetypeRepository=http://sakarum.sourceforge.net/maven2/
Configure your database properties in src/main/webapp/WEB-INF/application.properties
Create your entities in src/main/java/{com.mycompany.myapp.entity}, implements SakarumEntity and use JPA 2 annotations to configure database mapping
public class MyEntity implements SakarumEntity<Integer>{ //Specify the type of your entity key
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Integer id;
[...]
@Override
public Integer getId(){
return id;
}
@Override
public void setId(Integer id){
this.id = id;
}
}
mvn clean compile sakarum:generate
mvn package
Copy the generated war from src/target/xxxxx.war to your tomcat webapps directory and enjoy your application !
2012 - Sakarum Project - last update 2011.06.20