我必须启动一个简单的 Spring 项目(它是一个批处理文件,对数据库执行查询,然后迭代获得的记录)。
我总是从 Eclipse 创建 Spring 项目,现在我必须从 IntelliJ(社区版)创建。
我正在尝试执行文件 --> 新建 --> 项目,这里我选择Maven,但我找不到与简单 Spring 命令行应用程序结构相关的原型(prototype)。为什么?
如何在 IntelliJ 中创建简单的 Spring 命令行应用程序?
最佳答案
1) 添加插件“Maven Archetype Catalogs”到 Intelij
1.1) File -> Settings -> Plugins -> Browse repositories...
1.2) Search for "Maven archetype" and look for the "Maven Archetype Catalogs"
1.3) Click on Install button of that plugin. After finished click the restart intelij button
2) 在 Intelij 上创建一个新项目基于 Spring Boot 示例简单原型(prototype)
2.1) File -> New -> Project
2.2) Check the option "Create from archetype" and click the Add Archetype button
2.3) Fill the window fields with the following information
GroupId: org.springframework.boot
ArtifactId: spring-boot-sample-simple-archetype
Version: 1.0.2.RELEASE
Repository: http://central.maven.org/maven2/
2.4) Click OK
这将告诉 intelij 下载新的原型(prototype)并创建一个新的 Maven 项目 基于此原型(prototype)以及使用 Spring Boot CommandLinner 的示例源代码
关于java - 如何在 IntelliJ 中正确创建简单的命令行 Spring 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43636596/