Archive

Archive for July, 2011

Adding file to Maven Repository with Maven

July 21, 2011 Comments off

Maven has made compiling Java projects almost an effortless job. You no longer need to worry about placing all the required class files in your classpath. All you have to do is to include dependencies in your POM file and Maven takes care of the rest. It automatically downloads the jar file that your project depends on and include them in your build classpath. But what if you want to include a jar file that is not available from Maven repositories? To include such jar files you will have to manually install the jar into your local maven repository. Let say you need Oracle driver which is included in ojdbc14.jar. Download the jar file from Oracle and then execute following command.

C:\>mvn install:install-file -Dfile=ojdbc14.jar -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0 -Dpackaging=jar

Then add this dependency to your project POM file.

      com.oracle
      ojdbc14
      10.2.0
      compile
Now when you build your project ojdb14.jar will be available.

You can follow the same steps for your own jar files. For example if you have created a jar file (e.g. utils.jar) of helper classes and need that jar file in some other project you will first install the jar to your repository and then add the dependency in your POM file.

C:\>mvn install:install-file -Dfile=utils.jar -DgroupId=com.zparacha.example -DartifactId=utils -Dversion=1.0 -Dpackaging=jar

And the dependency for your POM will be like

      com.zparacha.example
      utils
      1.0.0
      compile

And all the class files will become available to your project.
Enjoy.

 

Reference : http://www.zparacha.com/include-externaljar-file-in-maven/

Categories: General

VirtualBox:cannot able to ping from guest to host.

July 4, 2011 Comments off

Chose Adapter type in Virtual Box as bridged.

and add this firewall run in the host machine.

Control Panel –> System and security –> Windows Firewall –> Advanced settings –> Inbound rules –> New rule –> custom rule in Protocol and ports: Protocol: ICMPv4 on the same panel go to customize, choose “Specific ICMP types”, check the box “echo request” The rest is trivial; go to next… next… and save it. You should be done. This box responds ping from this point on.

Categories: Virtual Box

Command for creating the Virtual IP-Address in Linux

July 4, 2011 Comments off
Categories: General, Linux/Unix

Command for creating the Virtual IP-Address in Windows

July 4, 2011 Comments off
Categories: General
%d bloggers like this: