如何在 IntelliJ Community Edition 2016.1.3 中启用 spring 支持
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38019094/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to enable spring support in IntelliJ Community Edition 2016.1.3
提问by Nicolas S.Xu
I have very good pure Java basic knowledge. As long as there are no XML config and no project management tools involved, I am very good.
我有很好的纯Java基础知识。只要不涉及XML config,不涉及项目管理工具,我就很好。
The things that really confused me are the project management tools, e.g.: Maven, Gradle.
真正让我困惑的是项目管理工具,例如:Maven、Gradle。
I am learning Spring, and it is so confusing to me since it involves many XML files and there is no clear explanation for it.
我正在学习 Spring,它让我很困惑,因为它涉及许多 XML 文件并且没有明确的解释。
I am learning Spring from this setof video tutorials, Lecture 6
Spring "Hello World".
我正在通过这组视频教程学习 Spring ,第 6 讲
Spring “Hello World”。
I couldn't get a Spring hello world done because it requires a xxxxx.xml file to config the beans (Java object). To generate the XML files, I need to generate an XML file using a plugin on IntelliJ 2016.
我无法完成 Spring hello world,因为它需要一个 xxxxx.xml 文件来配置 bean(Java 对象)。要生成 XML 文件,我需要使用 IntelliJ 2016 上的插件生成 XML 文件。
The question is I can't find the plugin to generate a XML file for the bean by following this official tutorial. There is no such plugin called " Spring Support".
问题是我找不到按照官方教程为 bean 生成 XML 文件的插件。没有这样的插件叫做“Spring Support”。
What should I do to generate the beans.xml? (The file to manage beans for Spring)
我应该怎么做才能生成 beans.xml?(用于管理 Spring bean 的文件)
采纳答案by Naresh Kumar
Let's take things one by one:
让我们一件一件来看:
Your problem understanding builds management tools like maven and gradle. Try these links for tutorials: Maven in 5 Minutes, gradle is very advance build automation tool with continuous Integration features, you can find a good comparison between gradle and maven here.
If you are confused about spring to try this book: Spring in Action 3rd Edition (4th Edition is also available, I recommend 3rd edition as you will be able to link XML to annotations.)
You do not need any tool to generate XML files. Copy a sample spring configuration file from the internet, remove unwanted elements and write your own beans.
您对问题的理解构建了 maven 和 gradle 等管理工具。试试这些教程链接:Maven in 5 Minutes,gradle 是非常先进的构建自动化工具,具有持续集成功能,你可以在这里找到 gradle 和 maven 之间的一个很好的比较。
如果您对 spring 感到困惑,请尝试这本书:Spring in Action 3rd Edition(第 4 版也可用,我推荐第 3 版,因为您将能够将 XML 链接到注释。)
您不需要任何工具来生成 XML 文件。从 Internet 复制示例 spring 配置文件,删除不需要的元素并编写自己的 bean。
回答by Huy Tran
You can't enable Spring support with IntelliJ community Edition, it only available with paying version (Ultimate).
However, you can create the .xml file manually and CE version also supports it (a little bit).
To working with Spring or J2EE, you should get familiar with build tools like Maven, Gradle (or Ant in some special case). The concept is simple and you can get it easily from the official website (https://maven.apache.org/- http://gradle.org/).
For Spring, if you don't familiar with creating a .xml file, you can use Java configuration instead or move to use Spring-boot to forget this configuration file (almost).
However, at first, I think you should get the basic concept of Spring and try to work well with .xml files configure. It'll be helpful in the future when you work with it deeply.
您无法使用 IntelliJ 社区版启用 Spring 支持,它仅适用于付费版本(终极版)。
但是,您可以手动创建 .xml 文件并且 CE 版本也支持它(一点点)。
要使用 Spring 或 J2EE,您应该熟悉构建工具,如 Maven、Gradle(或在某些特殊情况下使用 Ant)。这个概念很简单,您可以从官方网站(https://maven.apache.org/- http://gradle.org/)轻松获取。
对于 Spring,如果你不熟悉创建 .xml 文件,你可以改用 Java 配置,或者改用 Spring-boot 来忘记这个配置文件(几乎)。
但是,首先,我认为您应该了解 Spring 的基本概念并尝试使用 .xml 文件配置。当您深入使用它时,它将在未来有所帮助。
回答by yole
The Spring support plugin is a feature of IntelliJ IDEA Ultimate, which is a commercial IDE. It's not available in the free Community Edition.
Spring 支持插件是 IntelliJ IDEA Ultimate 的一个特性,它是一个商业 IDE。它在免费社区版中不可用。
You don't need any plugin to generate the beans.xml file; you can write it manually in the source code editor.
您不需要任何插件来生成 beans.xml 文件;您可以在源代码编辑器中手动编写它。
回答by vissu
For Spring support, did you try "Spring Assistant" plugin ?
对于 Spring 支持,您是否尝试过“Spring Assistant”插件?
https://plugins.jetbrains.com/plugin/10229-spring-assistant
https://plugins.jetbrains.com/plugin/10229-spring-assistant
Good part it is it has active development.
好的部分是它有积极的发展。
回答by wintermute
I love the Jetbrains IDE but when I'm done looking at the pretty colors and it's time to do some real work, I head back to Eclipse... It's 2020, 3 years past the original post and JetBrains STILL doesn't support Spring in it's CE. You have to pay $500 for the Ultimate edition or not use Spring, or hack it in the CE. Or, quite honestly, just use Eclipse.
我喜欢 Jetbrains IDE,但是当我看完漂亮的颜色并且是时候做一些真正的工作时,我又回到了 Eclipse ......现在是 2020 年,比原来的帖子晚了 3 年,而 JetBrains 仍然不支持 Spring在它的 CE。你必须为 Ultimate 版支付 500 美元,或者不使用 Spring,或者在 CE 中破解它。或者,老实说,只需使用 Eclipse。
回答by enayat tahvildari
I know you are asking about IntelliJ Idea but as it is a commercial tool, you should pay to let you use its plugins. Another way is using "Spring Tools for Eclipse" which is a great environment to develop Spring applications. But you need to be familiar with eclipse. It can be downloaded from: Spring Tools 4 for Eclipse
我知道您在询问 IntelliJ Idea,但由于它是一个商业工具,您应该付费让您使用它的插件。另一种方法是使用“Spring Tools for Eclipse”,这是开发 Spring 应用程序的绝佳环境。但是你需要熟悉eclipse。可从以下位置下载: Spring Tools 4 for Eclipse