WildFly,原名 JBoss AS(JBoss Application Server) 或者 JBoss,是一套应用程序服务器,属于开源的企业级 Java 中间件软件,用于实现基于 SOA 架构的 Web 应用和服务。 WildFly 包含一组可独立运行的软件。web
WildFly采用积极的方法进行内存管理。开发基本运行时服务是为了最大程度地减小堆分配。这些服务在重复的完整解析中使用公共的缓存索引元数据,从而减小了堆和对象的流失。模块化类加载的使用可防止重复类和加载超出系统配置要求的类。这不只减小了基本内存开销,并且还有助于最大程度地减小垃圾收集器的暂停。最后,管理控制台是100%无状态的,而且彻底由客户端驱动。它会当即启动,而且须要服务器上的零内存。spring
下面咱们说一下主要的实现方式和步骤:apache
须要添加war的打包方式,<packaging>war</packaging>
缓存
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <archive> <manifestEntries> <Dependencies>jdk.unsupported</Dependencies> </manifestEntries> </archive> </configuration> </plugin>
须要先排除springboot web里的tomcat,而后使用provider级别的tomcat,即wildfly里的tomcat
<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-tomcat</artifactId> <scope>provided</scope> </dependency>
FROM jboss/wildfly ADD target/a-start-hot-deploy.war /opt/jboss/wildfly/standalone/deployments/demo.war
运行以后的效果以下:
访问地址为:`http://localhost:8080/demo`,其中demo为应用程序的名称springboot