springboot+xjar加密打包部署教程

需求背景

为了跟上时代的步伐,为了更好的生存。开个玩笑,就是心血来潮,使用xjar加密部署jar包,于是就测试一下。

xjar教程

1-maven配置文件修改

首先找到自己ideal配置的maven文件夹,然后找到apache-maven-3.9.3\conf\settings.xml

// 如果配置了aliyun或者其他的仓库就需要添加【,!jitpack.io】
// 如果没有配置,直接忽略  <mirrors><mirror><id>maven-default-http-blocker</id><mirrorOf>external:http:*,!jitpack.io</mirrorOf><name>Pseudo repository to mirror external repositories initially using HTTP.</name><url>http://0.0.0.0/</url><blocked>true</blocked></mirror></mirrors>

2-pom文件修改

打开自己的maven项目,然后修改pom文件

    <!-- 增加xjar依赖仓库 --><pluginRepositories><pluginRepository><id>jitpack.io</id><url>https://jitpack.io</url></pluginRepository></pluginRepositories><build><plugins><!-- 如果还有其他的plugin,继续在后面追加下面的xjar即可 --><!-- xjar插件开始 --><plugin><groupId>com.github.core-lib</groupId><artifactId>xjar-maven-plugin</artifactId><version>4.0.2</version><executions><execution><id>xjar</id><phase>package</phase><goals><goal>build</goal></goals></execution></executions><configuration><targetJar>${project.artifactId}-xjar.jar</targetJar><!-- excludes配置节,不对哪些文件进行加密--><excludes><exclude>static/**</exclude><exclude>templates/**</exclude></excludes></configuration></plugin><!-- xjar插件结束 --></plugins></build>

 修改了pom文件后,点击重新编译按钮。

 3-maven打包

然后点击maven窗口的播放按钮进行命令打包。

# 打包命令,123456换成自己的密码
mvn clean package -Dxjar.password=123456

 这个命令执行完,会在target文件夹下面生成打包后的jar文件和xjar.go两个文件。注意新生成的jar文件比之前不加密生成的jar文件要大好多,我这边是2.56倍。然后把这两个文件上传到服务器上。

4-go环境部署

// go下载官网
https://studygolang.com/dl

 然后把文件上传到centos服务器上。

// 没有文件夹就自己创建,然后把下载的go1.22.0.linux-amd64.tar.gz文件上传到这个文件夹下
cd /opt/xjartar -zxvf go1.22.0.linux-amd64.tar.gz vim /etc/profile回车// 在文件的最后追加go地址
export PATH=$PATH:/opt/xjar/go/bin// 然后按esc键,在输入:wq 退出
// 输入刷新配置命令
source /etc/profile// 输入go版本查询命令
go version
// 如果出现版本信息,说明安装成功

5-启动脚本

 

-- 新建run-go.sh,内容如下。
-- xjar.go就是刚才maven的命令编译生成的。
-- 启动的时候需要先执行这个命令,这个命令执行完会生成xjar文件
go build xjar.go-- 新建run-xjar.sh,内容如下
-- 这个命令是通过xjar启动加密后的jar包
-- 注意事项,xjar -java -jar 后面必须跟jar文件所在的地址
-- 其余的配置信息在.jar文件的后面,需要注意先后顺序
nohup /opt/aiot/xjar java -jar /opt/aiot/aiot-xjar.jar -Xms1024m -Xmx1024m -XX:PermSize=256m --spring.profiles.acive=dev >> /dev/null 2>&1 &

结束

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

-----华丽的分割线,以下是凑字数,大家不用花时间看,快去改代码-----

package cn.renkai721.bean.vo;import lombok.extern.slf4j.Slf4j;@Slf4j
public class MakeUpTheWordCount {private String make_up_the_word_count_column_999999999_1;private String make_up_the_word_count_column_999999999_2;private String make_up_the_word_count_column_999999999_3;private String make_up_the_word_count_column_999999999_4;private String make_up_the_word_count_column_999999999_5;private String make_up_the_word_count_column_999999999_6;private String make_up_the_word_count_column_999999999_7;private String make_up_the_word_count_column_999999999_8;private String make_up_the_word_count_column_999999999_9;private String make_up_the_word_count_column_999999999_10;private String make_up_the_word_count_column_999999999_11;private String make_up_the_word_count_column_999999999_12;private String make_up_the_word_count_column_999999999_13;private String make_up_the_word_count_column_999999999_14;private String make_up_the_word_count_column_999999999_15;private String make_up_the_word_count_column_999999999_16;private String make_up_the_word_count_column_999999999_17;private String make_up_the_word_count_column_999999999_18;private String make_up_the_word_count_column_999999999_19;private String make_up_the_word_count_column_999999999_20;public String getMake_up_the_word_count_column_999999999_1() {return make_up_the_word_count_column_999999999_1;}public void setMake_up_the_word_count_column_999999999_1(String make_up_the_word_count_column_999999999_1) {this.make_up_the_word_count_column_999999999_1 = make_up_the_word_count_column_999999999_1;}public String getMake_up_the_word_count_column_999999999_2() {return make_up_the_word_count_column_999999999_2;}public void setMake_up_the_word_count_column_999999999_2(String make_up_the_word_count_column_999999999_2) {this.make_up_the_word_count_column_999999999_2 = make_up_the_word_count_column_999999999_2;}public String getMake_up_the_word_count_column_999999999_3() {return make_up_the_word_count_column_999999999_3;}public void setMake_up_the_word_count_column_999999999_3(String make_up_the_word_count_column_999999999_3) {this.make_up_the_word_count_column_999999999_3 = make_up_the_word_count_column_999999999_3;}public String getMake_up_the_word_count_column_999999999_4() {return make_up_the_word_count_column_999999999_4;}public void setMake_up_the_word_count_column_999999999_4(String make_up_the_word_count_column_999999999_4) {this.make_up_the_word_count_column_999999999_4 = make_up_the_word_count_column_999999999_4;}public String getMake_up_the_word_count_column_999999999_5() {return make_up_the_word_count_column_999999999_5;}public void setMake_up_the_word_count_column_999999999_5(String make_up_the_word_count_column_999999999_5) {this.make_up_the_word_count_column_999999999_5 = make_up_the_word_count_column_999999999_5;}public String getMake_up_the_word_count_column_999999999_6() {return make_up_the_word_count_column_999999999_6;}public void setMake_up_the_word_count_column_999999999_6(String make_up_the_word_count_column_999999999_6) {this.make_up_the_word_count_column_999999999_6 = make_up_the_word_count_column_999999999_6;}public String getMake_up_the_word_count_column_999999999_7() {return make_up_the_word_count_column_999999999_7;}public void setMake_up_the_word_count_column_999999999_7(String make_up_the_word_count_column_999999999_7) {this.make_up_the_word_count_column_999999999_7 = make_up_the_word_count_column_999999999_7;}public String getMake_up_the_word_count_column_999999999_8() {return make_up_the_word_count_column_999999999_8;}public void setMake_up_the_word_count_column_999999999_8(String make_up_the_word_count_column_999999999_8) {this.make_up_the_word_count_column_999999999_8 = make_up_the_word_count_column_999999999_8;}public String getMake_up_the_word_count_column_999999999_9() {return make_up_the_word_count_column_999999999_9;}public void setMake_up_the_word_count_column_999999999_9(String make_up_the_word_count_column_999999999_9) {this.make_up_the_word_count_column_999999999_9 = make_up_the_word_count_column_999999999_9;}public String getMake_up_the_word_count_column_999999999_10() {return make_up_the_word_count_column_999999999_10;}public void setMake_up_the_word_count_column_999999999_10(String make_up_the_word_count_column_999999999_10) {this.make_up_the_word_count_column_999999999_10 = make_up_the_word_count_column_999999999_10;}public String getMake_up_the_word_count_column_999999999_11() {return make_up_the_word_count_column_999999999_11;}public void setMake_up_the_word_count_column_999999999_11(String make_up_the_word_count_column_999999999_11) {this.make_up_the_word_count_column_999999999_11 = make_up_the_word_count_column_999999999_11;}public String getMake_up_the_word_count_column_999999999_12() {return make_up_the_word_count_column_999999999_12;}public void setMake_up_the_word_count_column_999999999_12(String make_up_the_word_count_column_999999999_12) {this.make_up_the_word_count_column_999999999_12 = make_up_the_word_count_column_999999999_12;}public String getMake_up_the_word_count_column_999999999_13() {return make_up_the_word_count_column_999999999_13;}public void setMake_up_the_word_count_column_999999999_13(String make_up_the_word_count_column_999999999_13) {this.make_up_the_word_count_column_999999999_13 = make_up_the_word_count_column_999999999_13;}public String getMake_up_the_word_count_column_999999999_14() {return make_up_the_word_count_column_999999999_14;}public void setMake_up_the_word_count_column_999999999_14(String make_up_the_word_count_column_999999999_14) {this.make_up_the_word_count_column_999999999_14 = make_up_the_word_count_column_999999999_14;}public String getMake_up_the_word_count_column_999999999_15() {return make_up_the_word_count_column_999999999_15;}public void setMake_up_the_word_count_column_999999999_15(String make_up_the_word_count_column_999999999_15) {this.make_up_the_word_count_column_999999999_15 = make_up_the_word_count_column_999999999_15;}public String getMake_up_the_word_count_column_999999999_16() {return make_up_the_word_count_column_999999999_16;}public void setMake_up_the_word_count_column_999999999_16(String make_up_the_word_count_column_999999999_16) {this.make_up_the_word_count_column_999999999_16 = make_up_the_word_count_column_999999999_16;}public String getMake_up_the_word_count_column_999999999_17() {return make_up_the_word_count_column_999999999_17;}public void setMake_up_the_word_count_column_999999999_17(String make_up_the_word_count_column_999999999_17) {this.make_up_the_word_count_column_999999999_17 = make_up_the_word_count_column_999999999_17;}public String getMake_up_the_word_count_column_999999999_18() {return make_up_the_word_count_column_999999999_18;}public void setMake_up_the_word_count_column_999999999_18(String make_up_the_word_count_column_999999999_18) {this.make_up_the_word_count_column_999999999_18 = make_up_the_word_count_column_999999999_18;}public String getMake_up_the_word_count_column_999999999_19() {return make_up_the_word_count_column_999999999_19;}public void setMake_up_the_word_count_column_999999999_19(String make_up_the_word_count_column_999999999_19) {this.make_up_the_word_count_column_999999999_19 = make_up_the_word_count_column_999999999_19;}public String getMake_up_the_word_count_column_999999999_20() {return make_up_the_word_count_column_999999999_20;}public void setMake_up_the_word_count_column_999999999_20(String make_up_the_word_count_column_999999999_20) {this.make_up_the_word_count_column_999999999_20 = make_up_the_word_count_column_999999999_20;}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/521888.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

微信小程序可拖拽视频播放案例

微信小程序可拖拽视频播放案例 如图所示 使用原生小程序组件 movable-area movable-view 注意movable-view必须在area内 官方组件地址 wxml <movable-area class"movableArea"><movable-view class"movableView" out-of-bounds"false&q…

SRS服务器ffmpeg 推流rtmp超时中断

ffmpeg错误显示 failed to update header with correct duration failed to update header with correct filesize. Error writing trailer of rtmp://----- broken pipe SRS日志错误显示 serve error code2056 kickoffforidle : service cycle : rtmp stream service: timeou…

YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information

paper: https://arxiv.org/abs/2402.13616 code YOLOv9: Learning What You Want to Learn Using Programmable Gradient Information 一、引言部分二、问题分析2.1 信息瓶颈原理2.2 可逆函数 三、本文方法3.1 可编程梯度信息 四、实验4.1消融实验部分 今天的深度学习方法关注的…

Python之Web开发中级教程----搭建Git环境

Python之Web开发中级教程----搭建Git环境一 Git 是目前世界上最先进的分布式版本控制系统 作用&#xff1a;代码管理。方便多人协同开发&#xff1b;方便版本控制。 安装git 单人本地仓库 建立本地仓库目录 配置个人管理信息 git config –global user.email 32356105163.com…

电子商务平台中商品数据采集|API数据接口采集商品的高效性体现

电子商务平台由一个个产品所构成,通过对产品的分析可以有效发掘用户需求,优化店铺产品结构,提升客户粘性、客单价、销售利润等。 一、产品行业数据采集API接口 采集产品行业数据的核心目的是了解该产品的市场需求变化情况,常用到的数据采集指标包括产品搜索指数和产品交易指数两…

【Vue 3】

v-model 作用&#xff1a;给表单元素使用&#xff0c;双向数据绑定---->可以快速获取或设置表单元素内容 是value属性和input事件的合写 数据变化--->视图自动更新试图变化--->数据自动更新 语法&#xff1a;v-model"变量" 数据变&#xff0c;视图跟着变…

ELK介绍使用

文章目录 一、ELK介绍二、Elasticsearch1. ElasticSearch简介&#xff1a;2. Elasticsearch核心概念3. Elasticsearch安装4. Elasticsearch基本操作1. 字段类型介绍2. 索引3. 映射4. 文档 5. Elasticsearch 复杂查询 三、LogStash1. LogStash简介2. LogStash安装 四、kibana1. …

如何在Windows系统部署Jellyfin Server并实现公网访问内网影音文件

文章目录 1. 前言2. Jellyfin服务网站搭建2.1. Jellyfin下载和安装2.2. Jellyfin网页测试 3.本地网页发布3.1 cpolar的安装和注册3.2 Cpolar云端设置3.3 Cpolar本地设置 4.公网访问测试5. 结语 1. 前言 随着移动智能设备的普及&#xff0c;各种各样的使用需求也被开发出来&…

超算互联网统一存储平台技术研究

大家好&#xff0c;我是来自山东省计算中心&#xff08;国家超级计算济南中心&#xff09;的王春晓&#xff0c;我从2022年开始参与超算互联网的项目&#xff0c;主要负责算网统一存储平台的研发&#xff0c;在存储基座方面也做了很多调研&#xff0c;最后选择了Alluxio平台&am…

测试常用的Linux命令

前言 直接操作硬件 将把操作硬件的代码封装成系统调用&#xff0c;供程序员使用 虚拟机软件 可以模拟的具有完整硬件系统的功能 可以在虚拟机上安装不同的操作系统 Linux内核只有一个&#xff0c;发行版有很多种 内核来运行程序和管理像磁盘和打印机等硬件设备的核心程序 终端…

【物联网】stm32芯片结构组成,固件库、启动过程、时钟系统、GPIO、NVIC、DMA、UART以及看门狗电路的全面详解

一、stm32的介绍 1、概述 stm32: ST&#xff1a;指意法半导体 M&#xff1a;指定微处理器 32&#xff1a;表示计算机处理器位数 与ARM关系:采用ARM推出cortex-A&#xff0c;R,M三系中的M系列&#xff0c;其架构主要基于ARMv7-M实现 ARM分成三个系列&#xff1a; Cortex-A&…

她力量:致敬计算机领域的第一位女性先驱

在每年的3月8日&#xff0c;我们庆祝国际妇女节&#xff0c;以此来纪念和赞扬女性在社会、经济、文化和政治等各个领域所取得的杰出成就。而今天&#xff0c;我们特别想要回顾并致敬一位在计算机科技历史上留下了不可磨灭印记的女性——她&#xff0c;就是阿达洛芙莱斯&#xf…