菜鸟的学习笔记
打包资源文件的处理
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0modelVersion>
<parent>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-parentartifactId>
<version>2.2.5.RELEASEversion>
<relativePath/>
parent>
<groupId>com.stugroupId>
<artifactId>spscaclaartifactId>
<version>0.0.1-SNAPSHOTversion>
<name>spscaclaname>
<description>Demo project for Spring Bootdescription>
<properties>
<java.version>1.8java.version>
<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8maven.compiler.encoding>
<encoding>UTF-8encoding>
<maven.compiler.source>1.8maven.compiler.source>
<maven.compiler.target>1.8maven.compiler.target>
<joda-time.version>2.9.9joda-time.version>
<commons-io>2.6commons-io>
<scala.version>2.11.12scala.version>
<plugin.maven.scala.version>3.1.3plugin.maven.scala.version>
properties>
<dependencies>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-webartifactId>
dependency>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-devtoolsartifactId>
<scope>runtimescope>
<optional>trueoptional>
dependency>
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-testartifactId>
<scope>testscope>
<exclusions>
<exclusion>
<groupId>org.junit.vintagegroupId>
<artifactId>junit-vintage-engineartifactId>
exclusion>
exclusions>
dependency>
<dependency>
<groupId>org.jsoupgroupId>
<artifactId>jsoupartifactId>
<version>1.11.3version>
dependency>
<dependency>
<groupId>joda-timegroupId>
<artifactId>joda-timeartifactId>
<version>${joda-time.version}version>
dependency>
<dependency>
<groupId>commons-iogroupId>
<artifactId>commons-ioartifactId>
<version>${commons-io}version>
dependency>
<dependency>
<groupId>org.scala-langgroupId>
<artifactId>scala-libraryartifactId>
<version>${scala.version}version>
dependency>
dependencies>
<build>
<resources>
<resource>
<directory>src/main/javadirectory>
<includes>
<include>**/*.xmlinclude>
includes>
resource>
<resource>
<directory>src/main/resourcesdirectory>
<excludes>
<exclude>pica/*.jpgexclude>
<exclude>pics/*.**exclude>
<exclude>rebel.xmlexclude>
excludes>
resource>
<resource>
<directory>${project.basedir}/libsdirectory>
<targetPath>BOOT-INF/lib/targetPath>
<includes>
<include>**/*.jarinclude>
includes>
resource>
resources>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-resources-pluginartifactId>
<version>3.0.2version>
<executions>
<execution>
<id>copy-resourcesid>
<phase>packagephase>
<goals>
<goal>copy-resourcesgoal>
goals>
<configuration>
<resources>
<resource>
<directory>src/main/resourcesdirectory>
<excludes>
<exclude>pics/*.**exclude>
excludes>
resource>
resources>
<outputDirectory>${project.build.directory}/configoutputDirectory>
configuration>
execution>
executions>
<configuration>
<encoding>${project.build.sourceEncoding}encoding>
configuration>
plugin>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-jar-pluginartifactId>
<version>3.0.2version>
<configuration>
<excludes>
<exclude>static/**exclude>
excludes>
<archive>
<manifest>
<addClasspath>trueaddClasspath>
<classpathPrefix>lib/classpathPrefix>
<mainClass>com.stu.spscacla.SpscaclaApplicationmainClass>
<useUniqueVersions>trueuseUniqueVersions>
manifest>
<manifestEntries>
<Class-Path>config/Class-Path>
manifestEntries>
archive>
configuration>
plugin>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-dependency-pluginartifactId>
<version>3.0.1version>
<executions>
<execution>
<phase>packagephase>
<goals>
<goal>copy-dependenciesgoal>
goals>
<configuration>
<outputDirectory>${project.build.directory}/liboutputDirectory>
<overWriteReleases>falseoverWriteReleases>
<overWriteSnapshots>falseoverWriteSnapshots>
<overWriteIfNewer>trueoverWriteIfNewer>
<includeScope>compile
includeScope>
configuration>
execution>
executions>
plugin>
<plugin>
<groupId>net.alchim31.mavengroupId>
<artifactId>scala-maven-pluginartifactId>
<version>3.2.2version>
plugin>
<plugin>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-maven-pluginartifactId>
<configuration>
<layout>ZIPlayout>
<includes>
<include>
<groupId>cn.jstarsgroupId>
<artifactId>datatocloudartifactId>
include>
includes>
configuration>
plugin>
plugins>
build>
project>