惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
Vercel News
Vercel News
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
N
News and Events Feed by Topic
Application and Cybersecurity Blog
Application and Cybersecurity Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 【当耐特】
WordPress大学
WordPress大学
Google Online Security Blog
Google Online Security Blog
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
Help Net Security
Help Net Security
V
Visual Studio Blog
Jina AI
Jina AI
H
Heimdal Security Blog
小众软件
小众软件
O
OpenAI News
腾讯CDC
The Last Watchdog
The Last Watchdog
雷峰网
雷峰网
Cloudbric
Cloudbric
量子位
博客园_首页
The GitHub Blog
The GitHub Blog
L
LangChain Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
T
The Blog of Author Tim Ferriss
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Last Week in AI
Last Week in AI
V2EX - 技术
V2EX - 技术
Security Archives - TechRepublic
Security Archives - TechRepublic
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 司徒正美
M
MIT News - Artificial intelligence
大猫的无限游戏
大猫的无限游戏
T
Tor Project blog
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
B
Blog
C
Check Point Blog
TaoSecurity Blog
TaoSecurity Blog
T
Threatpost
Hugging Face - Blog
Hugging Face - Blog
Recent Announcements
Recent Announcements
Project Zero
Project Zero
Hacker News: Ask HN
Hacker News: Ask HN
U
Unit 42
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - 果然如此

微信小程序UI组件、开发框架、实用库 sql查询优化--数字转换字符串字段 Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad Git简易的命令行入门教程 .NET Framework 历史版本(2017年) 深入理解 JavaScript 事件循环(一)— event loop TypeScript白鹭引擎Egret防止按钮事件冒泡穿透 maven多模块启动required a bean of type com.xxx.xxx.service that could not be found. idea常用快捷键 启动类加注解@MapperScan spring boot mybatis 启动错误 Maven项目mybatis Invalid bound statement (not found)解决方法 Re:从零开始的Spring Security Oauth2(三) Re:从零开始的Spring Security Oauth2(二) Re:从零开始的Spring Security Oauth2(一) typescript多维对象数组仿List泛型 TypeScript 基本语法 idea新建maven项目没有src目录 spring boot 错误:Check your ViewResolver setup 《乔布斯传》经典摘录(七)
spring boot maven多模块打包部署到tomcat
果然如此 · 2018-04-08 · via 博客园 - 果然如此
@SpringBootApplication(scanBasePackages = {"com.xxx.*"})
public class ApiApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ApiApplication.class);
    }
    public static void main(String[] args) {
        SpringApplication.run(ApiApplication.class, args);
    }
}

api的pom.xml

<build>
        <plugins>

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- 指定该Main Class为全局的唯一入口 -->
                    <mainClass>com.xxx.api.ApiApplication</mainClass>
                    <layout>ZIP</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--maven打包排除spring-boot内嵌tomcat容器依赖jar-->
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.0.0</version>
                <configuration> 
                    <!--打包后的名称-->
                    <warName>xxx-api</warName>
                    <packagingExcludes>
                        WEB-INF/lib/tomcat-embed-*.jar,
                        WEB-INF/lib/spring-boot-starter-tomcat-*.jar
                    </packagingExcludes>
                </configuration>
            </plugin>            
        </plugins>
    </build>

cmd进入项目根目录单独打包api模块:

mvn -pl xxx-api -am install