smartboot 开源组织 smartboot 开源组织
首页
  • smart-socket
  • smart-http
  • smart-servlet
  • smart-mqtt
  • smart-license
  • feat
❤️开源捐赠
💰付费服务
🏠加入社区
  • Gitee (opens new window)
  • Github (opens new window)
首页
  • smart-socket
  • smart-http
  • smart-servlet
  • smart-mqtt
  • smart-license
  • feat
❤️开源捐赠
💰付费服务
🏠加入社区
  • Gitee (opens new window)
  • Github (opens new window)
  • 使用手册

    • 关于
    • Maven 插件
    • Springboot 部署
    • War 包部署
  • 商业授权
  • 发版记录

Maven 插件

这是一种类似:tomcat-maven-plugin的使用方式,通常应用于 Java Web 工程的本地开发环境。 集成该插件只需在 pom.xml 中加入以下代码,便可以在 IDE 中启动 servlet 服务。

<build>
    <plugins>
        <plugin>
            <groupId>org.smartboot.servlet</groupId>
            <artifactId>smart-servlet-maven-plugin</artifactId>
            <version>${最新版本号}</version><!--最新版本 -->
            <configuration>
                <port>8080</port>
                <path>/</path>
            </configuration>
        </plugin>
    </plugins>
</build>
1
2
3
4
5
6
7
8
9
10
11
12
13

插件的版本建议采用最新版本,另外主要的配置项包括:

  • port:servlet服务启动的监听端口
  • path:Servlet容器上下文路径,即 ContextPath,通常以/表示。当然也支持自定义,但必须以/开头

完成配置后在控制台输入:mvn package smart-servlet:run即可。

关于
Springboot 部署

← 关于 Springboot 部署→

Theme by Vdoing | Copyright © 2017-2026 三刀
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式