Is it possible to adopt IntelliJ IDEA Community Edition for web-development?

大城市里の小女人 提交于 2019-12-03 09:40:12
gcooney

Sure it's possible. I mean, it's possible to do web development in a text editor. The real question is what do you lose/how much of a pain it is. Some things that you will need to set up:

  • A task to build and deploy your WAR file locally(ant, maven, etc.)
  • To debug your project in IntelliJ CE, you'll need to spend some time setting up a run profile to launch your application server.

Even with that stuff set-up, you'll still be missing any convenience features specific to web development(beans won't automatically show links to relevant xml configurations, getters/setters used for dependency injection will probably show unused method warnings, etc.)

I'd say whether IntelliJ CE is a reasonable choice for web-development depends on how strongly you prefer IntelliJ to other editors, how comfortable you are with web-development in general(since you won't get any editor suggestions or warnings), and how complex the web components of your project are.

EDIT: This answer is now outdated. There is a war plugin in gradle that can be used directly by IntelliJ. Original contents follow, but please don't do this anymore.

We were using this gradle file:

apply from: 'https://raw.githubusercontent.com/icoloma/gradle-plugins/master/webapp.gradle'

group = 'com.mycompany'
version = '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version:'3.0.1'
}

Then execute gradle idea or gradle eclipse to generate a project that can be deployed in IntelliJ Community Edition.

The long explanation is available here and the source code is available as a Github project.

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