Eclipse Keyboard Shortcut

  1. Import a class - cntrl + space (gives suggestion of available classes if multiple/ predefined template).
  2. Suggest Name - cntrl + 1 ( gives you suggestions for names).
  3. Search - Cntrl + H ( file searches, java search , git search, can use wildcards using *).
  4. Organise imports - Cntrl + Shift + O ( imports all necessary packages/class)
  5. Search Resources - Cntrl + Shift + R/T ( search for resources like classes)
  6. F3 - open declaration ( opens the code of the class/method)
  7. F4 - Type HIerarchy (for example see what Hashmap inherits ).
  8. Opens all shortcuts - Cntrl + Shift + L
  9. Alt + arrowmark - move between windows in eclipse.
  10. Shift + Arrows - Selecting faster (Home , End).
  11. Cntrl + Shift + F - Formatting the code.
  12. Cntl + D - delete that particular line.
  13. Cntrl + O - Quick Outline.
  14. Cntrl + Shift + G - method invocations

MavenĀ 

  1. POM - project object model, contains all the configurations for the particular project.
  2. SNAPSHOT - indicates the project under development.
  3. Maven gets the transitive dependencies also.
  4. To build a jar i need to compile and run ( for java and test code) but maven makes this process easy.
  5. 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.
  6. 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.