当前位置: 首页 > news >正文

网站建设字图做招投标应该了解的网站

网站建设字图,做招投标应该了解的网站,wordpress模板左上角的logo换成自己的,怎么区分营销型和展示型的网站文章目录 前言1. 创建5个配置文件2. 在pom.xml文件中如下配置3. 在application.properties中加入环境变量 前言 在我们开发项目的时候#xff0c;一般有四套环境#xff1a;日常、测试、预发、正式。日常环境作为我们开发环境#xff1b;测试环境给测试同学测试功能#x… 文章目录 前言1. 创建5个配置文件2. 在pom.xml文件中如下配置3. 在application.properties中加入环境变量 前言 在我们开发项目的时候一般有四套环境日常、测试、预发、正式。日常环境作为我们开发环境测试环境给测试同学测试功能预发环境给正式环境发布时提供准备正式环境则是稳定的生产环境。 这四套环境数据库、中间件以及其他一些配置多多少少都有一些不同所以如果我们只用一个application配置文件的话肯定是有问题的一般的做法是准备4个配置文件用来区分4个环境每个文件填入的配置内容互不干扰然后在项目打包的时候指定文件即可。 如下图 具体做法 1. 创建5个配置文件 这5个配置文件分别为 application.properties application-daily.properties application-test.properties application-pre.properties application-publish.properties项目结构如下 这里可能有同学有疑惑既然有了4个环境的配置文件为啥还要有application.properties这个文件 这里的application.properties我们可以当做是一个配置文件容器它可以将其他配置文件的内容加到这里来。还有一个原因就是因为SpringBoot项目启动的时候只认识application.properties文件不认识其他四个。 2. 在pom.xml文件中如下配置 ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsdmodelVersion4.0.0/modelVersionparentgroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-parent/artifactIdversion2.7.5/versionrelativePath/ !-- lookup parent from repository --/parentgroupIdcom.example/groupIdartifactIdSpringBoot-config/artifactIdversion0.0.1-SNAPSHOT/versionnameSpringBoot-config/namedescriptionDemo project for Spring Boot/descriptionpropertiesjava.version1.8/java.version/propertiesdependenciesdependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-web/artifactId/dependencydependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-test/artifactIdscopetest/scope/dependency/dependencies!-- 添加四个环境的变量变量名为environment --profilesprofileiddaily/idactivationactiveByDefaulttrue/activeByDefault/activationpropertiesenvironmentdaily/environment/properties/profileprofileidtest/idpropertiesenvironmenttest/environment/properties/profileprofileidpre/idpropertiesenvironmentpre/environment/properties/profileprofileidpublish/idpropertiesenvironmentpublish/environment/properties/profile/profiles!-- 指定打包插件以及解压路径 --buildfinalNamespringbootconfig/finalNameresourcesresource!-- 指定配置文件所在的resource目录 --directorysrc/main/resources/directoryincludesincludeapplication.properties/includeincludeapplication-${environment}.properties/include/includesfilteringtrue/filtering/resourceresourcedirectorysrc/main/resources/directoryincludesincludelogback.xml/include/includesfilteringfalse/filtering/resourceresourcedirectorysrc/main/resources/directoryfilteringfalse/filteringexcludesexclude*.xml/excludeexclude*.properties/exclude/excludes/resource/resourcespluginsplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactIdversion2.1.13.RELEASE/versionexecutionsexecutiongoalsgoalrepackage/goal/goals/execution/executionsconfigurationmainClasscom.example.springbootconfig.SpringBootConfigApplication/mainClass/configuration/plugin!-- 解压fat jar到target/${project-name}目录 --pluginartifactIdmaven-antrun-plugin/artifactIdexecutionsexecutionphasepackage/phaseconfigurationtasksunzipsrc${project.build.directory}/${project.build.finalName}.${project.packaging}dest${project.build.directory}/springbootconfig//tasks/configurationgoalsgoalrun/goal/goals/execution/executions/pluginplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactId/plugin/plugins/build /project这里我的配置有3个部分直接复制我这个文件的同学要注意了。 第一部分 !-- 添加四个环境的变量变量名为environment --profilesprofileiddaily/idactivationactiveByDefaulttrue/activeByDefault/activationpropertiesenvironmentdaily/environment/properties/profileprofileidtest/idpropertiesenvironmenttest/environment/properties/profileprofileidpre/idpropertiesenvironmentpre/environment/properties/profileprofileidpublish/idpropertiesenvironmentpublish/environment/properties/profile/profiles这个部分可以直接复制。这里设置environment变量它的值一共有4个即daily、test、pre、publish通过activeByDefault标签设置daily为默认配置。 第二部分 resourcesresource!-- 指定配置文件所在的resource目录 --directorysrc/main/resources/directoryincludesincludeapplication.properties/includeincludeapplication-${environment}.properties/include/includesfilteringtrue/filtering/resourceresourcedirectorysrc/main/resources/directoryincludesincludelogback.xml/include/includesfilteringfalse/filtering/resourceresourcedirectorysrc/main/resources/directoryfilteringfalse/filteringexcludesexclude*.xml/excludeexclude*.properties/exclude/excludes/resource /resources这个部分也可以直接复制。这里配置是指定打包那些类型的文件有时候我们会遇到这样一个问题发现有些文件不管怎么打包都没法打到jar包里面去其实就是这个地方没有配置默认给过滤掉了。 第三部分 pluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdversion3.8.1/versionconfigurationsource1.8/sourcetarget1.8/targetencodingutf-8/encoding/configuration/pluginplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-source-plugin/artifactIdversion2.2/versionexecutionsexecutionidattach-sources/idgoalsgoaljar/goal/goals/execution/executionsconfigurationfinalName${project.build.finalName}/finalName/configuration/pluginplugingroupIdorg.springframework.boot/groupIdartifactIdspring-boot-maven-plugin/artifactIdversion2.1.13.RELEASE/versionexecutionsexecutiongoalsgoalrepackage/goal/goals/execution/executionsconfigurationmainClasscom.example.springbootconfig.SpringBootConfigApplication/mainClass/configuration/plugin /plugins这个部分要注意后面的mainClass这里要写你们自己的类路径不要搞错了。这里指定了打包和解压的插件和文件路径还有启动类。这里的插件一个都不能少且路径不要配置错误否则有可能会出现打包失败或者启动时找不到启动类 3. 在application.properties中加入环境变量 application.properties文件中有一个配置spring.profiles.active。指定它就可以指定当前运行的环境配置如下 spring.application.nameSpringBoot-config server.port8080 management.server.port8081 spring.mvc.view.prefix/ spring.mvc.view.suffix.html#通过配置的方式激活环境 spring.profiles.activeenvironment 如果这个时候你是使用的是idea开发工具那么在右侧的maven插件中就已经可以看到这几个环境了 当然没有idea开发工具的同学也不用担心我们接下来直接使用打包指令就可以了 日常环境打包指令 mvn clean package -Dmaven.test.skiptrue -Pdaily 测试环境打包指令 mvn clean package -Dmaven.test.skiptrue -Ptest 预发环境打包指令 mvn clean package -Dmaven.test.skiptrue -Ppre 正式环境打包指令 mvn clean package -Dmaven.test.skiptrue -Ppublish 打包出来的文件如下 这里就会出现你想要指定环境的配置文件application.properties中的environment变量也会被替换为 pring.application.nameSpringBoot-config server.port8080 management.server.port8081 spring.mvc.view.prefix/ spring.mvc.view.suffix.html#环境激活 spring.profiles.activepublish 当然平时调试的时候使用默认的日常环境配置就可以了打包的时候再去指定具体的环境即可。
http://wiki.neutronadmin.com/news/292125/

相关文章:

  • seo建站是什么wordpress收录查询
  • 长沙门户网站有哪些企业网站建设一站式服务
  • 惠州行业网站设计方案广州越秀发布
  • 网站维护 html跨境电商到什么网站做
  • 美食网站开发步骤grace8WordPress主题
  • 洛阳网站建设启辰网络网站正在建设_敬请期待!
  • 郑州做网站推广的公司哪家好中小型互联网企业有哪些
  • 当今做啥网站能致富gooood谷德设计网站
  • 企业网站seo价格任丘市做网站价格
  • 图片在线编辑网站单页面中添加wordpress的评论
  • 同仁网站建设公司网站开发和嵌入式开发
  • 网站开发技术服务费做商城网站多少钱
  • 做视频网站要什么软件下载网站上资源截图怎么做
  • 长安网站建设流程网站建设策划怎么沟通
  • 找个免费网站这么难吗怎么做游戏自动充值的网站
  • 企业网站建设推广公司旅游新闻最新消息
  • 无锡制作网站价格表做图片视频的网站有哪些问题
  • 怎么做html5网站吗上海教育网站前置审批
  • 私人路由器做网站台北网站建设
  • 专业网站设计发展前景泰安网站制作推荐
  • 百度推广移动端网站wordpress 当前菜单
  • 网站运行模式公司网站建设技术方案
  • 能源建设投资有限公司网站wex5可以做网站吗
  • 网站空间管理权限关键词seo是什么
  • wordpress访问网站很慢云服务器品牌前十大排名
  • 公司网站开发实施方案专业图片在线制作网站
  • 服务五象新区开发建设指挥部网站典型的o2o平台有哪些
  • 一号网站建设做软件常用的网站有哪些软件有哪些
  • 手机英语学习网站触屏版手机wap用户登陆注册网站模板115艺术网站欣赏
  • 软件销售网站模板做网站投资多少钱