Web fragment project creation using Intellij IDEA

Answered

Hi,

Seems creating a web fragment project (According to servlet 3.0 spec) using Intellij IDEA is not very simple. In Eclipse as part of the new project creation wizard, there's an option called "Web Fragment Project".

Now that's would not have been a huge disadvantage if not for these factors,

1) Web fragments often just contain java classes like servlet, filters etc. so there's no "web" directory required. If I select the web project options while creating a new project and then remove the "web" directory, and adding a META-INF/web-fragment.xml file in source folder should have been fine, except web projects are required to be bundled up in jar files and not war files. Intellij won't let me create a jar as artifact because technically it's a web project.

2) Second way of doing it might have been creating a simple java project and then adding the META-INF folders in source along with the META-INF/web-fragment.xml except the fact that you can't create a servlet/filter in a simple java project without manually typing every detail

I'm having to use eclipse for coming up with the web fragment projects which is disappointing for two reasons a) I have a paid version of Intellij IDEA Ultimate and still having to use eclipse and b) I really really am fond of this IDE and want to stick to it at any cost.

If there's any way out of this please help me with that. I would really appreciate that.

 

Thanks & regards,

Kingshuk

0
2 comments

Hi, you could use Tools | Save Project as Template, to create a user defined Project template and invoke it via New Project wizard.

1

Hi Petr,

Thanks so much for your insight. That is awesome and it makes it really easier.

Appreciate the help...!!

Thanks,

Kingshuk

0

Please sign in to leave a comment.