java聚合工程编译及部署

DT公司,安排野火IM的server开发工作。野火IM_QuickStart

通过github desktop,下载工程

[email protected]:wildfirechat/server.git

环境要求,jdk:1.8;MySQL:5.7.27。

导入工程后,可以看到这是个聚合工程。

    <modules>
        <module>broker</module>
        <module>common</module>
        <module>sdk</module>
        <module>distribution</module> 
        <!-- distribution是一个发布模块,仅有脚本文件 -->
    </modules>

点击侧边栏Maven。
!](https://img-blog.csdnimg.cn/20200408114157910.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L25laGVxaQ==,size_16,color_FFFFFF,t_70)

点击Wildfire Chat的show dependencies按钮,查看依赖。
在这里插入图片描述
点击root的pom下的clean->compile,之后在distribution/target下生成相应的tar包。 distribution-0.39-bundle-tar.tar.gz

命令行解压到目录

使用root用户,执行

sh ./bin/wildfirechat.sh

后台执行可以使用命令

nohup sh ./bin/wildfirechat.sh 2>&1 &

确保退出终端时程序能够继续运行

执行相应系统的启动命令之后,等待10秒钟后,在浏览器中输入

http://${服务器的IP}/api/version

查看版本信息。

脚本文件 wildfirechat.sh

$JAVA -server $JAVA_OPTS $JAVA_OPTS_SCRIPT 
-Dlog4j.configuration="file:$LOG_FILE" 
-Dcom.mchange.v2.c3p0.cfg.xml="$C3P0_CONF_FILE" 
-Dhazelcast.configuration="file:$HZ_CONF_FILE" 
-Dwildfirechat.path="$WILDFIRECHAT_PATH" 
-cp "$WILDFIRECHAT_HOME/lib/*" cn.wildfirechat.server.Server

前几个运行几个服务,最后cn.wildfirechat.server.Server是一个自定义启动类。

访问本地restful api

curl http://192.168.149.2/api/version
{
	"tags":"null",
	"branch":"wildfirechat",
	"dirty":"null",
	"remoteOriginUrl":"[email protected]:wildfirechat/server.git",
	"commitId":"null",
	"commitIdAbbrev":"2ba54a4",
	"describe":"0.29-1-148-g2ba54a4-dirty",
	"describeShort":"null",
	"commitUserName":"heavyrain.lee",
	"commitUserEmail":"[email protected]",
	"commitMessageFull":"撤回消息时带上被撤回消息的信息\n",
	"commitMessageShort":"撤回消息时带上被撤回消息的信息",
	"commitTime":"20200406112931",
	"closestTagName":"null",
	"closestTagCommitCount":"null",
	"buildUserName":"Hawkii",
	"buildUserEmail":"[email protected]",
	"buildTime":"20200408103756",
	"buildHost":"null",
	"buildVersion":"null"
}
发布了17 篇原创文章 · 获赞 0 · 访问量 216

猜你喜欢

转载自blog.csdn.net/neheqi/article/details/105383523
今日推荐