How to Setup Dozer Mapper

Imagine a POJO that has lot of member variables and you need to map this object into a new java object. For this you will need to manually write setter for the new object taking values from old object. Dozer mapper makes this task very easy with few lines of code. Lets see the ways to setup Dozer mapper for our use.

Setup Dozer mapper using Maven

Using the maven dependencies directly we can setup the Dozer mapper. We have taken the latest Dozer mapper version available while writing this post

Setup Dozer mapper using direct jars

You can also use the Dozer mapper jar (dozer-5.5.1.jar) directly. But note that there are few other dependent jars that you need to add for the Dozer mapper to function properly. This is the list of mandatory jars that we need

1. commons-beanutils-1.9.1.jar
2. commons-lang3-3.2.1.jar
3. jcl-over-slf4j-1.7.5.jar
4. slf4j-api-1.7.5.jar

Please check the Dozer Mapper Simple Example

References

1. Dozer Docs

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn