java - 如何在 IntelliJ 中正确创建简单的命令行 Spring 应用程序?

标签 java spring maven intellij-idea ide

我必须启动一个简单的 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/

相关文章:

java - 如何读取 strings.xml 作为文件?

java - 使用 jpa/hibernate Spring 添加新条目时在 Postgresql 中增加值

java - 调整独立应用程序以使用 Spring

java - 没有 Struts 和 Maven 的 JSP Tiles

java - DynaActionForm 和 ActionForm 有什么区别?

java - 能够在 Linux 上通过 Java 和/或 Spring Security 修改 Active Directory

java - 如何从 JsonUnit 获取断言结果?

spring - 通过 @RequestMapping 名称构建的 URL 无法按自定义名称的预期工作

maven - Hadoop的版本和Hadoop-common的版本有什么关系?

java - file.html 在本地主机上正确显示,但在服务器上不正确显示