自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 收藏
  • 关注

原创 通过Environment中取key含有自定义的值,放入JSONObject中

前端时间,要用Environment中获取内容,但是网上基本上找不到。需求:在application.yml中,myshelf.test后含有自定义的内容,在Springboot启动时,无法对application.yml中的XXX进行绑定赋值到实体类的属性上。-application.ymlmyshelf: test: xxxx开始@Autowiredprivate Environment env;public JSONObject getEnvTest(){JSONObject

2021-06-26 13:01:24 209

原创 maven打可执行jar包

<build> <finalName>myshlf-test</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration><skipT

2021-06-01 14:48:57 90

原创 读取jar中MF文件以及pom.xml中的版本号

前端时间,接到了,让读取项目的版本号,如果仅仅是开发环境的话,可以直接读取pom文件,但是如果是jar或者是war时,可能就不到jar里面的pom.xml,所以最后查看jar中有MANIFEST.MF有版本号,同时采用这个方法。因为项目关系就不进行截图了。第一种:读取pom.xml的版本号(仅仅适合开发环境使用):引入依赖<dependency> <groupId>org.apache.maven</groupId> <artifactId>mave

2020-11-04 11:18:24 1498 3

原创 junit4 测试代码覆盖率,被测试方法含有全局变量(SpringBoot等适用)

如果用junit4 测试代码覆盖率,而方法中使用了全局变量,针对这个问题,今天留下保存,以便后期使用。//TestApublic class TestA{ @Autowired private TestB testB; String[] str = {"-","="}; public void getTestB(){ testB = new TestB(); String text = testB.getName()+str[0]+testB.getAge(); System.out.pr

2020-09-11 15:52:35 1167

原创 通过栈(先进后出)思想把{}{}之间的数据放到集合中

public void static main(String[] args){String text ="{a:A,b:B}|{c:C,d:D};{e:E,f:F} {h:H,q:Q}";List<String> List = new ArrayList<String>();StringBuffer sb = new StringBuffer("");//申明一个stackStack<Character> stack = new Stack<Charact

2020-09-11 15:28:17 104

转载 用StringBuffer和正则表达式 替换小括号()中的双引号

String str = "{\"a\":\"A\",\"b\":\"@java.lang.Integer@parseInt(str.substring(1\",\"string.length()-1))\"}"; //匹配小括号的内容 Pattern p = Pattern.compile("\\((.*)\\)"); Matcher m = p.matcher(str); String temp = null; StringBuffer sb = new Strin

2020-09-11 14:50:09 638

转载 转载别人的内容

非常有用的网址:https://www.cnblogs.com/dlight/p/get.html转载

2020-07-16 11:39:14 60

原创 nginx替换配置文件nginx.conf并启动nginx 脚本

#!/bin/sh#脚本的当前位置url=`dirname $0`cd $url#获取进入的目录位置pass=`pwd`nginxConfPath="/nginx.conf"#把nginx.conf文件放置到目录下appNginxConfPath="/app/temp"deployDirPath="/home/dede"deployNginxConfPath="/nginx/conf"nPass="/nginx/"cd $deployDirPathconf=`pwd`#把/app

2020-07-16 09:51:57 971

原创 win10 win7 截图快捷键

1.win10截图快捷键 win+shift+A2.win7截图快捷键 选中截图工具,右键,在快捷键同时按 Ctrl+Shift+A ==>  Ctrl+Shift+A3.新建txt文件,输入: start snippingtool  保存成  截图.bat  ;双击也可以截图...

2020-06-05 13:35:16 394

原创 List去重

List去重1、List去重list.stream().distinct().collect(Collectors.toList());2、List 去重List lst = getFunction()(获取数据库的数据);//去重含有实体类的List集合,并保持顺序不变Set newSet = new HashSet();List nList = new ArrayList();...

2020-05-02 15:45:47 207

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除