Archive for the ‘Java’ Category

How to: Execute shell script in java code

Friday, April 17th, 2009

I was trying to use both shell scripts and java to do automation of some sort and I got into thinking, what if I insert shell script in my java code?

Here’s an example:

String command = "echo Hello World!!";

ProcessBuilder pb = new ProcessBuilder("bash", "-c", command);
pb.redirectErrorStream(true);
Process shell = pb.start();

Introducing: Maven Plugin (from Apache)

Tuesday, November 18th, 2008

MavenTwo weeks ago I attended an internal training about Maven Plugin. It was a briefing about what Maven can do as a standalone plugin and what it can do if collaborated with Archiva and/or Continuum.

Maven, to give a simple definition, is a tool for organizing and managing build projects. With this, developers who are members of one team will find it easy to comprehend all of on-going development projects.

And as an open source plugin, it can be integrated with Eclipse and Netbeans IDE, which are open source IDEs for Java.

Soon enough, my colleague will be conducting another training that will deal with the implementation per se. However, you can visit Maven’s website for more information and FAQs.