SpringBoot 多模块打包jar,部署启动 访问页面404

项目正常运行,访问jsp页面出现404,查了一圈发现只能使用1.4.2.RELEASE,修改spring-boot-starter-parent版本为1.4.2.RELEASE

在web模块/启动类所在模块添加打包方式为 jar,添加build打包方法
<packaging>jar</packaging>

完整配置如下

		<plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>1.4.2.RELEASE</version>
                <configuration>
                    <!-- 指定该Main Class为全局的唯一入口 -->
                    <mainClass>cf.xxx.xxx.HaiApplication</mainClass>
                    <layout>ZIP</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <finalName>demo</finalName><!--指定打包名字-->

猜你喜欢

转载自blog.csdn.net/drsarah/article/details/104801476