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

為{幸葍}努か 提交于 2019-12-21 03:14:12

问题


Currently I'm using IntelliJ IDEA for non-web projects, but I'd love to use it for web development. Unfortunately IntelliJ IDEA Ultimate Edition's price (220 Euro) is to high for me currently and that's why I'm forced to use STS(Springsource Tool suite).

And I'm wondering is there a way to adopt IntelliJ IDEA CE version for web-development? Of course I could just use crack or write one but it's not my style.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/5553672/is-it-possible-to-adopt-intellij-idea-community-edition-for-web-development

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