我试图在jboss/wildfly中部署我的应用程序(springboot中的一个示例-restwebservice),我想听听您对一个奇怪行为的反馈。
我在网上学习了很多教程(例如,本教程),现在,我可以手动部署它(例如,通过执行 mvn clean install
将war移到deployment文件夹),但当我自动执行时,spring引导模块不会执行(服务器运行时没有错误,但没有sprint引导内容,因此我的class/webservice不可用)。我指的是“在服务器上进行清理”视图
战争是不同的。虽然工作war(由mvn安装构建)似乎包含所有spring框架包(在org包中):
clean创建的war(我使用的是jboss tools 4.17.0.final plugin)没有这些(请注意,包“com”指的是我的代码)
我已经用springtoolsuite4和eclipse(尽管jbosstools是同一个插件)以及jbosseap7.3.0和wildfly21测试了它,得到了相同的结果。
这正常吗?有人有同样的问题吗?我正在复制并粘贴pom.xml,因为它可能与以下内容相关:
<?xml version="1.0" encoding="UTF-8"?>
<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>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.2.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.slb.csi</groupId>
<artifactId>csi-services</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>csi-services</name>
<description>CSI project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
<start-class>com.CsiServiceApplication</start-class>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>springbootwildfly</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>2.0.0.Final</version>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
暂无答案!
目前还没有任何答案,快来回答吧!