您现在的位置是:主页 > news > 企业建设好一个网站后_如何进行网站推广?/网店怎么开

企业建设好一个网站后_如何进行网站推广?/网店怎么开

admin2025/5/20 7:05:14news

简介企业建设好一个网站后_如何进行网站推广?,网店怎么开,南阳网站建设与管理,手机网站域名哪里注册用eclipse做springboot项目时&#xff0c;由于生产上是动静态分离配置&#xff0c;jar文件中不需要html,css,js等静态文件 解决办法是&#xff1a; 在pom.xml文件中加入配置 指定排除的部分 <resources><resource><directory>src/main/resources</dire…

企业建设好一个网站后_如何进行网站推广?,网店怎么开,南阳网站建设与管理,手机网站域名哪里注册用eclipse做springboot项目时&#xff0c;由于生产上是动静态分离配置&#xff0c;jar文件中不需要html,css,js等静态文件 解决办法是&#xff1a; 在pom.xml文件中加入配置 指定排除的部分 <resources><resource><directory>src/main/resources</dire…

用eclipse做springboot项目时,由于生产上是动静态分离配置,jar文件中不需要html,css,js等静态文件

解决办法是:

在pom.xml文件中加入配置

指定排除的部分

	<resources><resource><directory>src/main/resources</directory><excludes><exclude>**/*.css</exclude><exclude>**/*.js</exclude><exclude>**/*.html</exclude></excludes><filtering>false</filtering></resource></resources> 

指定需要打哪些资源文件

	<resources><resource><directory>src/main/resources</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><!--  <excludes><exclude>**/*.css</exclude><exclude>**/*.js</exclude><exclude>**/*.html</exclude></excludes> --><filtering>false</filtering></resource></resources> 

直接指定文件夹

	<!-- 打包资源指定  --><resources><resource><directory>src/main/resources</directory><includes><include>config/*.properties</include><include>mappers/*.xml</include><include>resources/r/index.html</include><include>resources/r/common/html/login.html</include><include>resources/r/common/html/main.html</include><include>resources/r/common/html/index.html</include><include>resources/r/common/html/error.html</include><include>resources/r/common/html/loginFail.html</include></includes><filtering>false</filtering></resource></resources> 

完整项目配置

<?xml version="1.0" encoding="UTF-8"?>
<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.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.5.2</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>com.v1</groupId><artifactId>se</artifactId><version>0.0.1-SNAPSHOT</version><name>se</name><description>se project for Spring Boot</description><properties><java.version>1.8</java.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins><!-- 打包资源指定  --><resources><resource><directory>src/main/resources</directory><includes><include>**/*.properties</include><include>**/*.xml</include></includes><!--  <excludes><exclude>**/*.css</exclude><exclude>**/*.js</exclude><exclude>**/*.html</exclude></excludes> --><filtering>false</filtering></resource></resources> </build></project>

备注:打完包后,如果项目重新在本地启动,可能会找不到资源文件,需要把上面的配置注释掉,并 重新build一下,就OK了