Build Tools (Ant, Maven)

  • In this post I’ll discuss why build tools are required and how they really work in top level.
  • For a specific build tool it expects the project to be in specific structure. E.g: web.xml and lib folder should be present only in WEB-INF folder. Then only it’ll be able to build and deploy. Like that each build tool have their own standards of default project structure. Another example is Maven expects pom.xml to be present in the project in the root directory.

Why Ant or Maven scripts are required?

  • So far we discussed that each build tool expects project to be in specific structure then only it can be able to build and deploy. If your project is not in specific structure which the build tool is expecting, then you can write a script (Ant script, Maven script) by giving the paths of required folders in the script, which makes the script to build and deploy the project.
  • Another reason for writing scripts is that, if you want to deploy the project with out manual process, you can write the script and prepare a batch file to do that job.

Sample Ant script:

you can find sample ANT script from below website:

https://docs.spring.io/docs/Spring-MVC-step-by-step/part1.html

Eclipse Shortcuts:

The post discuss about keyboard shortcuts for various function in Eclipse IDE which are very useful for rapid development.

Searching a file with its name:  Ctrl + Shift + R

Search a text in all the files: Ctrl + h (File Search tab)

Run java file: [Alt + Shift + X    & J] ,    [Ctrl + F11]

Navigate to the selected text in other places of file:   Ctrl + K

Organize Imports: Ctrl + Shift + O

To Navigate to the start/end of the block:  Ctrl + Shift+ P

To see the list of opened files and to navigate to them:  Ctrl + E

Suggestion when you are typing: Ctrl + Space

To get the list of methods which you can override:  [Alt +  Shift +  S     &  V]

To get the System.out.println();   [syso & Ctrl + Space]

To clear the breakpoints: Run-> Remove all breakpoints/ skip all breakpoints [this option will be shown only when application is running in debug mode]

To open IDE views (like console, variables) : Window -> show view

To know the result of a method: Ctrl+i