问题描述
我喜欢通过创建类似的模块在maven中配置我的应用程序;
I like to configure my applications in maven by creating modules like;
<groupId>com.app</groupId>
<artifactId>example-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>app-api</module>
<module>app-impl</module>
<module>app-web</module>
</modules>
模块然后使用'example-app'作为父项。
The modules then use the 'example-app' as the parent.
现在我想在我的网络应用程序中使用'spring-boot'。
Now I want use 'spring-boot' for my web application.
有没有办法配置maven以便我的'app-web'是一个弹簧启动应用程序?
Is there a way to configure maven so that my 'app-web' is a spring-boot application?
我面临的问题是你必须使用spring-boot作为父级。
The problem I'm facing is that you have to use spring-boot as a parent.
推荐答案
您不必使用spring-boot-starter-parent,它只是一种快速入门的方法。它提供的只是依赖管理和插件管理。你可以自己做,如果你想要一个中途步骤,你可以使用spring-boot-dependencies(或等效的父)来管理依赖项。为此,请使用
You don't have to use the spring-boot-starter-parent, it's just a way to get started quickly. All it provides are dependency management and plugin management. You can do both yourself, and you can use the spring-boot-dependencies (or equivalently the parent) to manage dependencies if you want a halfway step. To do that, use scope=import
like this
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<type>pom</type>
<version>1.0.2.RELEASE</version>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
这篇关于Maven模块使用spring-boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!