Update gradle script for avoid duplications and unwanted jars