Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom project structure in eclipse

Tags:

eclipse

I often use a eclipse plugins to quckliy generate project directory structure, for example Spring plugin helps to create WebContent folder to hold WEB-INF contents. But sometimes I create a projects with specific directory structure, always the same. Something like this:

[project_name]
-folder1
  -folderA
    -folderX
  -folderB
-folder2
  -dirC
-folder3

I know, that I can write my own ant/maven script to generate specific folders, but I don't want to manualy invoke scripts each time after project creating. I want to create a project template which I would use in the future.

What is the best way to create a this feature?

Should I create something like plugin? If yes, how would I do it?

like image 642
bontade Avatar asked Aug 25 '26 10:08

bontade


1 Answers

If you don't want to use a plugin or a script to generate the project structure, you're pretty limited.

Since you can create a project from existing source, you could create the folder structure on your filesystem, and whenever you are creating another project, tell Eclipse to "Create Project from existing source" and point it to your template folder.

If you want to write a plugin, you'll want to contribute a org.eclipse.jdt.ui.actions.OpenProjectWizard that creates the folder structure as part of the project generation. A good tutorial can be found at: http://cvalcarcel.wordpress.com/2009/07/08/writing-an-eclipse-plug-in-part-1-what-im-going-to-do/%20

like image 157
Kane Avatar answered Aug 29 '26 09:08

Kane



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!