Make Custom Project template in Eclipse IDE

て烟熏妆下的殇ゞ 提交于 2019-12-07 01:50:42

问题


I have been using Eclipse IDE for a long time. Its a really great IDE for Java/C/C++ (and other languages with its THOUSANDS of plugins). Every once in a while, I get the need for creating a Javax interface. To do this normally, I would setup the new java project then add what I need. But, wouldn't it be nice if I could just make a template project to automatically include the code for the files. How would I go about doing this? It it even possible? The Eclipse CDT can make a new project type. So can the Google ADT and Google App engine. So I would imagine it is possible. But how?


回答1:


You must write your Eclipse plug-in that implements org.eclipse.ui.newWizards extension point. You can extend an existing "New Java Project" wizard, and provide your custom project layout implementation (see the API).




回答2:


Regarding java projects you might be familiar with maven. Maven offers of project template mechanism called archetypes. I never created an own archetype but the explanation to do this (Guide to Creating Archetypes) does not seems to be so complicated.

So although this is not a special eclipse solution it might be helpful for you. Together with the m2eclipse plugin it also works nice together with eclipse.



来源:https://stackoverflow.com/questions/2761943/make-custom-project-template-in-eclipse-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!