Tag Archives: maven

MyBatis + Spring + Junit (The Missing Part)

We have seen in Mybatis + Spring (XML | Annotation) Mapper how to write a simple mybatis-spring app and what is actually needed to get it up and running. Here I will extend that sample code to cover more stuff that you may face in a real “coding”. We will see how to make a single select that will fetch the one and the many of a “one-to-many” relationship, who to use mybatis config file with spring (if you need it), how to test mybatis-spring code using junit and things you need to watch out!

H2 embedded database has been used to make this example easy to run. But you still can use it with other databases e.g. “MySql, Oracle,….”



  • How to use make a single select that will fetch all one to many records?
  • How to reference mybatis config file in spring xml config file?
  • How to test using junit?

Continue reading

Create Your Own Maven archetype (Spring MVC)

Maven gives the ability to build a new project from a predefined archetype templates i.e. it generates for us the basic files so we can start coding right away. However, sometimes we need to have our customized version of these templates, fortunately Maven gives us the ability to create those templates which will be used to build our projects.



  • How to create a new Maven archetype?
  • Build Spring MVC archetype.

Continue reading

Create Web App Using Maven, Add Jetty Plugin & Convert to Eclipse

Using Maven you can create the foundation for a java web project with a simple command. Also, you can run it easily using Jetty Maven plugin.



  • How to create web app project using maven?
  • How to run it using Jetty Maven plugin?
  • How to convert Maven project into Eclipse project?

Continue reading