Refer this XML file as ant build... create_p2_repo.xml
This will generate a p2 repo on the specified path.