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

做网站图结构企业文化建设

做网站图结构,企业文化建设,郑州网站制作工作室,企业应该找什么样的网站建设公司最近在客户现场部署项目,有两套环境,无法连接互联网,两套环境之间也是完全隔离,于是问题就来了,每次都要远程到公司电脑改完代码,打包,通过网盘(如果没有会员,上传下载慢…

最近在客户现场部署项目,有两套环境,无法连接互联网,两套环境之间也是完全隔离,于是问题就来了,每次都要远程到公司电脑改完代码,打包,通过网盘(如果没有会员,上传下载慢)或者远程工具传输,再用u盘拷贝到客户电脑,一个包400多Mb(所有的代码和依赖包以及配置文件都打在了一个jar包里面),传输一次10分钟,效率太低了,于是翻越资料找到一中更优雅的打包方式,每次只需要更新改过的包和配置文件即可,大大减少传输大小。

我们先看看nacos的压缩包解压开来的效果:

可以看到是一种很标准的打包方式,解压开来的文件夹都能够见名知意,下面是我改完maven打包方式之后的效果,实际过程中,也可以根据需要把脚本放到bin目录里面,只是我图简单,把停止和启动都写在了一个脚本里面,这么打包的好处是,后续改了代码和配置只需要替换相应的jar包和配置文件即可,而不用全量更新,我们自己写的代码jar包通常都是kb单位,远程桌面传输起来也很快:

conf:配置文件目录里面包含了logback配置文件,项目依赖的application.yml等配置文件:

lib:依赖的jar,包括第三方依赖包和自己项目里面的common,api等:

gisadmin-boot.jar:springboot启动类所在的jar包,start.sh启动脚本里面启动命令指定的就是这个jar

start.sh:启动脚本:

ps -ef | grep gisadmin-boot | grep -v grep | awk '{print $2}' | xargs -r kill -9# 等待几秒以确保进程被正确杀死
sleep 2# 确保日志目录存在
mkdir -p ./logs# 绝对路径启动 Java
nohup java -Duser.timezone=Asia/Shanghai -Dfile.encoding=utf-8 -cp ./gisadmin-boot.jar com.daspatial.gis.EarthApplication  > ./logs/gisadmin.log 2>&1 &sleep 2

下面就是关键的maven配置了(只写关键变更部分):

1、不同的环境,激活不同的配置:在maven打包命令执行的时候指定,比如mvn clean compile package -Pdev -DskipTests,其中-Pdev就是激活dev环境的配置

    <profiles><profile><id>dev</id><properties><profileActive>dev</profileActive></properties><activation><activeByDefault>true</activeByDefault></activation></profile><profile><id>wutiegaw</id><properties><profileActive>wutiegaw</profileActive></properties></profile><profile><id>wutie</id><properties><profileActive>wutie</profileActive></properties></profile><profile><id>prod</id><properties><profileActive>prod</profileActive></properties></profile></profiles>

2、build节点配置:

<build><!--最终打出来的包名--><finalName>${project.artifactId}</finalName><!--java代码源文件目录--><sourceDirectory>${basedir}/src/main/java</sourceDirectory><!--资源文件目录,主要是配置文件,也就是src/main/resources目录--><resources><resource><directory>${basedir}/src/main/java</directory><filtering>true</filtering><excludes><exclude>**/*.java</exclude></excludes></resource><resource><directory>${basedir}/src/main/resources</directory><excludes><exclude>**/assembly.xml</exclude></excludes></resource><resource><directory>${basedir}/src/main/env/${profileActive}</directory></resource></resources><plugins><plugin><artifactId>maven-compiler-plugin</artifactId><version>3.13.0</version><configuration><source>1.8</source><target>1.8</target></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-jar-plugin</artifactId><configuration><archive><manifestEntries><!--配置文件独立输出到conf目录--><Class-Path>conf/</Class-Path></manifestEntries><manifest><!--依赖包独立输出到lib目录--><addClasspath>true</addClasspath><classpathPrefix>lib/</classpathPrefix></manifest></archive><excludes><!--这里是为了防止配置文件被打进启动类所在的jar里面--><exclude>**/*.yml</exclude><exclude>**/*.xml</exclude></excludes></configuration></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>2.6</version><configuration><appendAssemblyId>false</appendAssemblyId><descriptors><!--assembly插件配置文件--><descriptor>${basedir}/src/main/resources/assembly.xml</descriptor></descriptors></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-deploy-plugin</artifactId><configuration><skip>true</skip></configuration></plugin></plugins></build>

3、assembly插件配置文件assembly.xml:

<?xml version="1.0"?>
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd"><id>${version}</id><formats><!-- zip,tar,tar.gz,tar.bz2,jar,dir,war --><format>tar.gz</format></formats><includeBaseDirectory>true</includeBaseDirectory><fileSets><fileSet><!--源代码中的bin目录输出到压缩包根目录--><directoryMode>0777</directoryMode><directory>${basedir}/src/bin</directory><fileMode>0777</fileMode><outputDirectory>.</outputDirectory><lineEnding>unix</lineEnding></fileSet><fileSet><!--激活的profile配置文件输出到conf目录--><directory>${basedir}/src/main/env/${profileActive}</directory><outputDirectory>conf</outputDirectory></fileSet></fileSets><files><file><!--logback配置文件输出到conf目录--><source>${basedir}/src/main/resources/logback.xml</source><outputDirectory>conf</outputDirectory></file><file><source>${basedir}/src/main/resources/banner.txt</source><outputDirectory>conf</outputDirectory></file><file><!--启动类jar输出到压缩包根目录--><source>${basedir}/target/${project.artifactId}.jar</source><outputDirectory>.</outputDirectory></file></files><dependencySets><dependencySet><useProjectArtifact>true</useProjectArtifact><outputDirectory>lib</outputDirectory><excludes><exclude>${project.groupId}:${project.artifactId}</exclude></excludes></dependencySet></dependencySets>
</assembly>

项目目录结构如下:

改完之后可能会出现spring无法加载配置文件,只需要右键选中dev环境加入到资源目录即可,也就是默认激活dev环境配置:

http://www.hkea.cn/news/626575/

相关文章:

  • 南山做网站公司怎么选择企业seo优化服务
  • 什么 电子商务网站建设与管百度招商加盟
  • 南召微网站开发手机优化大师官方版
  • 营销型网站技术特点网站推广网
  • 龙游县住房和城乡建设局网站百度seo优化方法
  • 深圳方维网站建设设计个人网站
  • wordpress 流量站百度应用
  • ps素材网seo在线工具
  • 岳阳网站开发公司html网站模板免费
  • 怎样用模板做网站优化网站技术
  • 全国新型疫情最新情况长沙网站搭建优化
  • 郑州网站建设规划seo建站教程
  • 购物网站 购物车界面如何做百度搜索网
  • 推广网站的图片怎么做外贸平台
  • 新手如何给自己的网站做优化bt种子磁力搜索
  • 成都学校网站制作遵义网站seo
  • d?t网站模版宁波seo在线优化哪家好
  • c做的网站淄博做网站的公司
  • 网站开发制作公司郑州网站建设外包
  • 注册域名用个人还是公司好长沙seo优化排名
  • 电子商务网站建设与维护展望今日新闻联播
  • 网站建设主流技术站长之家ping检测
  • 温州建设集团有限公司网站首页百度手机版网页
  • 广西网络干部学院官网seo推广人员
  • 可以做红娘的相亲网站江北seo综合优化外包
  • 公司建设网站需要注意什么软文广告示范
  • 高端网站建设 引擎技企业网页
  • 模仿别人网站百度外链查询工具
  • 教程建设网站广告免费发布信息平台
  • wordpress php5.4支持宁波seo排名优化