pom文件引入 插件 maven-resources-plugin 的 copy-resources插件,然后按照下面这样配置下,就可以轻松访问了!
<!--拷贝资源文件 copy-resources-->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-public</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/webapp/public</directory>
</resource>
</resources>
<outputDirectory>${project.build.directory}/public</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>