1. 程式人生 > >Springboot打jar包專案無法訪問jsp問題解決

Springboot打jar包專案無法訪問jsp問題解決

maven編譯外掛,請選擇1.4.2.RELEASE版本

pom.xml重要部分如下:

    <build>
		<finalName>你的專案名稱</finalName>
		<resources>
			<resource>
				<directory>${basedir}/src/main/webapp</directory>
				<targetPath>META-INF/resources</targetPath>
				<includes>
					<include>**/**</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
				<includes>
					<include>**/**</include>
				</includes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<version>1.4.2.RELEASE</version>
			</plugin>
		</plugins>
	</build>