【发布时间】:2020-10-15 18:02:02
【问题描述】:
我有一个包含 4 个模块和一个父 POM 的 maven 项目。
在“mvn clean package”之后,生成了4个jar文件:
application-0.0.1-SNAPSHOT.jar
domain-0.0.1-SNAPSHOT.jar
exposition-0.0.1-SNAPSHOT.jar
infrastructure-0.0.1-SNAPSHOT.jar
但是,我想在 tomcar 服务器上部署这个应用程序。 我尝试在父 pom 中添加它,但包不起作用。
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
我不知道如何获取战争文件... 感谢您的帮助!
编辑
展示包的pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.example.projetfilrouge</groupId>
<artifactId>profil-skype</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>exposition</artifactId>
<dependencies>
<dependency>
<groupId>com.example.projetfilrouge</groupId>
<artifactId>application</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- AOP dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!-- springfox-swagger2 dependencies -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</dependency>
<!-- spring-security-test dependencies -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<!-- DevTools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<!-- JWT -->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.1</version>
</dependency>
</dependencies>
</project>
【问题讨论】:
-
所有这些项目都是spring-boot项目吗?还是只有一个是 Spring Boot 项目,其他是库?
-
这是一个带有 4 个 maven 项目模块的 spring boot 项目。
-
这 4 个人是否在其中一个类中都有 @SpringBootApplication 注释?
-
不,只有一个包:“博览会”;这个包包含带有@SpringBootApplication注解的RestController和主类
-
可以分享一下 exposition 模块的 pom.xml 文件吗?
标签: spring-boot maven deployment