【问题标题】:Maven archetype generate pull newer or latest templatesMaven 原型生成拉更新或最新的模板
【发布时间】:2019-08-20 17:31:19
【问题描述】:

我们可以使用 maven 使用 mvn archetype:generate 生成项目模板,然后选择一个原型编号。如果说我选择号码 1977 1977: remote -> org.springframework.boot:spring-boot-sample-tomcat-archetype (Spring Boot Tomcat Sample)。 Maven会生成java项目等等。

当我检查pom.xml 文件时,我看到了

<parent>
        <!-- Your own application should inherit from spring-boot-starter-parent -->
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.0.2.RELEASE</version>
</parent>

spring-boot-starter-parent 版本 1.0.2.RELEASE 似乎是 2014 年 4 月的。现在已经是 2019 年了。 https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-parent

我的 maven 版本是:apache-maven-3.5.4。

我们如何从 maven 获得更新的模板/原型?

【问题讨论】:

标签: java maven maven-3


【解决方案1】:

您可以在 github 上找到更新的示例:

https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-tomcat

但是,我认为 springboot 已经停止使用原型,转而使用 Spring Initializr。

在那里你可以选择你想要的任何版本并添加一个 Web 依赖项以包含 Tomcat 和 MVC 框架启动器。

【讨论】:

猜你喜欢
  • 2015-03-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多