Monthly Archives: June 2014

Maven Standard directory Layout

Having a standard set of protocols for a directory layout definitely eases the work of the developers as they need not break  head on understanding where the particular package is located and what it is actually doing. As we give a lot of importance for the naming convention, we do so for the directory layout as well even if these do not impact the final output. Here I am sharing the maven standard directory layout structure.

 

src/main/java Application/Library sources
src/main/resources Application/Library resources
src/main/filters Resource filter files
src/main/config Configuration files
src/main/scripts Application/Library scripts
src/main/webapp Web application sources
src/test/java Test sources
src/test/resources Test resources
src/test/filters Test resource filter files
src/it Integration Tests (primarily for plugins)
src/assembly Assembly descriptors
src/site Site
LICENSE.txt Project’s license
NOTICE.txt Notices and attributions required by libraries that the project depends on
README.txt Project’s readme

 

For reading the content in details please click here.

Useful Unix commands

A few days ago , I was asked to update an existing script and to make it generic for all instances. Though I understood still working in vi editor was difficult in the starting as I always ended up typing unwanted characters while moving the cursors or deleting the entire script instead of a particular line.

Working constantly for a few days I got to know a few useful commands few of them which I am sharing below:

  • To get rid of extra lines in vi editor ,  type esc -> :  -> g/^$/d
  • When you move a file from windows to unix environment you see a ^M character at the end of each line. You can remove them by using dos2unix <filename>  <filename> at the command prompt.
  • To a list of all the commands that has been used recently use history command.
  • Unix is sensitive to extra spaces. Don’t use a space before and after a = operator.
  • To go to home directory type cd ~
  • To delete n lines press esc then <n>dd
  • To go to the end of a line press esc $
  • To go to the begining press esc I
  • To exit and save esc : wq , to exit without saving esc : q!
  • To run the script , go to the script path then type ./<script name> or sh <script name>
  • To display the local queue manager of MQ Series in the server type : dspmq . For remote queue we need a WMQ client.
  • To find the IP address of the server type: grep ‘/etc/hosts/’ | awk ‘{print $0}’
  • To find the environment related details : env

Core Java presentations

Presentations are always useful at the last minute or even during understanding. I created them , this being one out of total of three covering important points for OCJP preparation. I will be publishing the rest very soon.

 

Basics Of Java-I

 

Attaching the second presentation of the series containing flow controls, loops, exceptions, strings and serialization. I am attaching here the pdf format of the presentation.

Basics Of Java – II

Starting Tomcat from the command line

If you happen to download the binary file of the tomcat server, you can start the server by running the startup.bat file in the binary folder of tomcat. I think most people would know this still when I started I had to spend quite a few time in understanding how to start the server. You can follow the following steps.

  • INSTALL JDK 1.7
  • COPY BINARY FILE OF TOMCAT TO <Drive>:\
  • GO TO COMMAND PROMPT TYPE  SET “JRE_HOME=%ProgramFiles%\Java\jre7”
  • AGAIN TYPE SET “CATALINA_HOME=E:\apache-tomcat-7.0.37” %CATALINA_HOME%\bin\startup.bat

OCJP 6 Certification

OCJP certification is often treated as one of the most toughest in the industry. That’s why they could earn you a lot more in the long run. I was primarily inspired by my seniors in the team to take up the exams and I followed their footsteps as they had earned the certification just the previous year.

It looks fine at the beginning when I started with Kathy and Bert but eventually got tougher. I could hardly remember the small stuffs and the sample questions were twisting. The certification  is even tougher if you have a job in hand and the time you would have speculated for the certification might keep on extending.  But finally I got through the exam and scored a 88%. Thanks to all my team members so provided me with useful materials for the exam preparation.