Eclipse Keyboard Shortcut
- Import a class - cntrl + space (gives suggestion of available classes if multiple/ predefined template).
- Suggest Name - cntrl + 1 ( gives you suggestions for names).
- Search - Cntrl + H ( file searches, java search , git search, can use wildcards using *).
- Organise imports - Cntrl + Shift + O ( imports all necessary packages/class)
- Search Resources - Cntrl + Shift + R/T ( search for resources like classes)
- F3 - open declaration ( opens the code of the class/method)
- F4 - Type HIerarchy (for example see what Hashmap inherits ).
- Opens all shortcuts - Cntrl + Shift + L
- Alt + arrowmark - move between windows in eclipse.
- Shift + Arrows - Selecting faster (Home , End).
- Cntrl + Shift + F - Formatting the code.
- Cntl + D - delete that particular line.
- Cntrl + O - Quick Outline.
- Cntrl + Shift + G - method invocations
MavenĀ
- POM - project object model, contains all the configurations for the particular project.
- SNAPSHOT - indicates the project under development.
- Maven gets the transitive dependencies also.
- To build a jar i need to compile and run ( for java and test code) but maven makes this process easy.
- Maven Build Life cycle -
- Validate - Validates the project
- Compile - compiles source code, compile test code
- Test - runs the unit code.
- Package - if tests are successful its builds a jar
- Verify
- Install - take the project and put in local repo.
- Deploy - take project and put it in remote maven repo.
- Commands - go to the project folder
- mvn clean install ( this command would execute all til install, clean deletes the jar from target folder).
- mvn clean compile ( mvn clean test-compile)
- mvn help-effective-settings - gives you all settings used by maven are printed.
- help:effective-pom -> entire content of the POM's including super pom is printed. (we can see all versions start to end).
- depedency:tree - gives you dependency tree.
- depedency:sources - downloads the sources for the dependency if available.
- if you want to debug for maven you can use like mvn compile - - debug.