2

I have created a plugin for Eclipse. With the help of this plugin, I am creating a new type of project, let's say XTypeProject. The creation of this XTypeProject is similar to any other type of project you create in Eclipse.

File -> New -> YourProjectType

I just want to know whether there is any way I can create a simple XTypeProject in Eclipse through some external mechanism, anything, and this project created through an external mechanism has to be similar to the project I create using Eclipse. Can Maven help me in this? Or is there any other way to do that?

Amos M. Carpenter
  • 4,848
  • 4
  • 42
  • 72
Ravish Rawat
  • 476
  • 2
  • 15
  • 48
  • Took the liberty of making the title a bit more succinct, and made small grammar and formatting improvements. Have you considered using [Ant](http://ant.apache.org/) for this task? – Amos M. Carpenter Jun 18 '15 at 07:40
  • @AmosM.Carpenter : Thanks for the edit, bro.No. I haven't tried ANT as of now, I am just looking into more options and will pick the best. – Ravish Rawat Jun 18 '15 at 08:09
  • 2
    It's been a while since I've fiddled with plugin-based projects in eclipse (RCP), but iirc your plugin should have some sort of "entry point" for new projects, i.e. some method that gets kicked off when the user creates a new project via the menu. Ant should be more than capable of - and in fact the perfect tool for - initiating that same call, though of course it may take some fiddling to get the classpath, plugins, etc. set up as required. [This answer](http://stackoverflow.com/a/12827451/983430) may help with that. – Amos M. Carpenter Jun 18 '15 at 08:43
  • Don't spam SO with duplicates of your question. Consider closing your previous one here http://stackoverflow.com/questions/30906954/java-code-to-create-a-project-in-eclipse-without-opening-eclipse – Josep Valls Jun 18 '15 at 20:21
  • I have marked that duplicate, sorry for the inconvenience. – Ravish Rawat Jun 19 '15 at 04:39
  • Hi Ravish Ravat, I'm looking for a plugin doing exactly what you are describing above (one that creates a custom project in eclipse) would you like to provide your code? That would be great! – carousally May 24 '18 at 14:17
  • Sorry Ravish, just realized the below answear ist yours. I undestand. sadly thank you ;) – carousally May 24 '18 at 14:54

1 Answers1

0

Here are my findings :-

  1. I went through the advice of Amos M. Carpenter and searched for the source code of the plugin that I have written.

  2. After that, I did a debug (Plugin Debug) and searched for the methods that are called when we create a project from the Eclipse menu.

  3. I took a note of all those class files and their methods that are called and the information/parameters they need for further processing.

  4. I initiated the same call through ANT and was able to do what I wanted.

Thank you for the support.

P.S - I can't share my Plugin details as it is written for an organisation.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Ravish Rawat
  • 476
  • 2
  • 15
  • 48