About plugin jar and war file creation

I could not figure out how shall I approach the creation of jar and war files from structured directories. For example: If I make a modification to anything into a Openfire plugin, like webchat plugin, and I would like to produce a new war from this directory, how shall I proceed?

  1. How shall I make usage of jar command line?

  2. How to garantee that during arquiving I am using the java version, which I am interested in?

  3. Which bits and tricks shall I be aware of?