2) How can I create plugin which I will use in another plugin like library (jar file)?
In the other plugin you have to add the first plugin in the dependencies