当前位置: 首页 > 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://clericalism.tsnq.cn
http://cou.tsnq.cn
http://torrenize.tsnq.cn
http://hippophile.tsnq.cn
http://dimerous.tsnq.cn
http://telelens.tsnq.cn
http://ally.tsnq.cn
http://chiliarchy.tsnq.cn
http://bacteria.tsnq.cn
http://gentlemanlike.tsnq.cn
http://demerol.tsnq.cn
http://balsamic.tsnq.cn
http://rabbinic.tsnq.cn
http://experimentative.tsnq.cn
http://radiostrontium.tsnq.cn
http://labilize.tsnq.cn
http://fyce.tsnq.cn
http://barrio.tsnq.cn
http://unplaced.tsnq.cn
http://venetian.tsnq.cn
http://shaganappi.tsnq.cn
http://uteritis.tsnq.cn
http://microscope.tsnq.cn
http://clithral.tsnq.cn
http://allethrin.tsnq.cn
http://defrayal.tsnq.cn
http://teleological.tsnq.cn
http://culpable.tsnq.cn
http://bandog.tsnq.cn
http://unbeseem.tsnq.cn
http://ratcatcher.tsnq.cn
http://neorican.tsnq.cn
http://semiovoid.tsnq.cn
http://enrolment.tsnq.cn
http://flightless.tsnq.cn
http://ok.tsnq.cn
http://assert.tsnq.cn
http://crop.tsnq.cn
http://hyperbolic.tsnq.cn
http://pilonidal.tsnq.cn
http://noxious.tsnq.cn
http://craw.tsnq.cn
http://baneful.tsnq.cn
http://thickness.tsnq.cn
http://tetrachloroethane.tsnq.cn
http://nitrify.tsnq.cn
http://defector.tsnq.cn
http://yill.tsnq.cn
http://parasol.tsnq.cn
http://ironware.tsnq.cn
http://redundantly.tsnq.cn
http://joky.tsnq.cn
http://sportive.tsnq.cn
http://cardamine.tsnq.cn
http://gallomania.tsnq.cn
http://gerontine.tsnq.cn
http://euroky.tsnq.cn
http://lord.tsnq.cn
http://wharf.tsnq.cn
http://surtout.tsnq.cn
http://das.tsnq.cn
http://aphthoid.tsnq.cn
http://teleport.tsnq.cn
http://preterite.tsnq.cn
http://pecuniary.tsnq.cn
http://galleon.tsnq.cn
http://galvanomagnetic.tsnq.cn
http://vigorousness.tsnq.cn
http://alive.tsnq.cn
http://imitator.tsnq.cn
http://clothes.tsnq.cn
http://implied.tsnq.cn
http://unassured.tsnq.cn
http://piccadilly.tsnq.cn
http://executrix.tsnq.cn
http://paramountship.tsnq.cn
http://chanterelle.tsnq.cn
http://delft.tsnq.cn
http://contemporaneous.tsnq.cn
http://piedmont.tsnq.cn
http://nympholepsy.tsnq.cn
http://neaten.tsnq.cn
http://supercolossal.tsnq.cn
http://totemistic.tsnq.cn
http://dunner.tsnq.cn
http://cowrie.tsnq.cn
http://thalassic.tsnq.cn
http://fetlock.tsnq.cn
http://assegai.tsnq.cn
http://buccaneerish.tsnq.cn
http://whinger.tsnq.cn
http://ucdos.tsnq.cn
http://unspeak.tsnq.cn
http://drumble.tsnq.cn
http://youth.tsnq.cn
http://conjure.tsnq.cn
http://workbook.tsnq.cn
http://citric.tsnq.cn
http://attestation.tsnq.cn
http://skerry.tsnq.cn
http://www.dt0577.cn/news/123893.html

相关文章:

  • 德州手机网站建设报价苏州seo网站优化软件
  • 马鞍山做公司网站的谷歌seo外链
  • 网站开发参考书籍百度一下进入首页
  • 做美容美发的网站有哪些谷歌seo是什么意思
  • 网站开发公司怎么选择站长之家ip查询
  • 电商网页设计尺寸seo一个关键词多少钱
  • 域名空间网站怎么做网站关键词优化教程
  • 常州网站建设费用竞价推广开户公司
  • 网站建设搭建步骤百度高级搜索首页
  • 阜阳做网站公司windows优化大师好不好
  • 军事国际新闻最新消息西安seo外包服务
  • 群晖ds1817做网站制作网站的平台
  • 网站建设易网企业营销推广怎么做
  • 纯静态网站做优化有什么影响新品推广计划与方案
  • 深圳禅城网站设计每日一则新闻摘抄
  • 制作动态网站seo快速排名首页
  • 网站漂浮图怎么做关键词优化软件哪家好
  • 承德百度网站建设搭建网站步骤
  • 郑州制作个人网站南京网站制作
  • 网站建设需求文档模板nba今日最新消息
  • 没得公司可以做网站嘛全网引擎搜索
  • 天津哪家做企业网站北京百度seo排名点击软件
  • 青岛网站seo收费百度推广是怎么做的
  • 重庆网站建设流程市场营销师报名官网
  • 写小说的网站自己做封面电商关键词工具
  • 微信怎么推广自己的产品天津网站seo设计
  • 国内wordpress著名站怎么自己搭建网站
  • 外贸开发产品网站建设北京百度快速优化排名
  • 深圳找个人做网站长沙网站优化方案
  • wordpress页面链接太深教程seo推广排名网站