Eclipse – Auto complete for static import

To enable auto complete for static field and methods from a given type you can add that type into Favorites section in the eclipse preference. Go to windows > preferences > java > editor > content assist > favorites and click on the New Type button and type in the absolute class name. (ie org.junit.Assert.*)
Continue reading…

 

Downloading all maven dependencies to a directory

Use case: Tired of having unwanted jars? Tired of finding dependent jars? Maven shall help to download all the dependencies of the project into a folder. Solution: If you already have a pom.xml execute command “mvn dependency:copy-dependencies” and you will find target/dependencies folder filled with all the dependencies. Else you can create simple pom.xml

Continue reading…

 

JSR 303 – How to write a custom validator?

Bean validation specifications. JSR 349 is the specification for Bean Validation 1.1. JSR 303 is the specification for Bean Validation 1.0 Bean validation is an important task irrespective of the architecture (enterprise web application or thick client-server) of the application. JSR 303 specification standardize the bean validation process. JSR 303 is not intended for use […]
Continue reading…

 

How to create java maven project in Eclipse?

In this post we will talk about creating java maven project. Steps involved in creating java maven project. 1. Lunch eclipse. Click “File->New->Maven Project” menu item. 2. In the new maven project dialog, select “create a simple project” check box and click “Next” button. 3. Give appropriate “Group Id”, “Artifact Id”, “Version” and “Packaging Type”. […]
Continue reading…