unzip -p charles.jar META-INF/MANIFEST.MF

https://blog.csdn.net/isea533/article/details/50278205

https://www.ibm.com/developerworks/cn/java/j-lo-spring-boot/index.html

[actuator] https://www.cnblogs.com/ckp-henu/p/spring-boot-actuator.html

首先是增加了<parent>
增加父pom比较简单,而且spring-boot-starter-parent包含了大量配置好的依赖管理,在自己项目添加这些依赖的时候不需要写<version>版本号。

使用父pom虽然简单,但是有些情况我们已经有父pom,不能直接增加<parent>时,可以通过如下方式:

<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.2.3.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

在我们开发过程中,我们需要经常修改,为了避免重复启动项目,我们可以启用热部署。

Spring-Loaded项目提供了强大的热部署功能,添加/删除/修改 方法/字段/接口/枚举 等代码的时候都可以热部署,速度很快,很方便。

想在Spring Boot中使用该功能非常简单,就是在spring-boot-maven-plugin插件下面添加依赖:

<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>springloaded</artifactId>
<version>1.2.5.RELEASE</version>
</dependency>
</dependencies>
1
2
3
4
5
6
7
添加以后,通过mvn spring-boot:run启动就支持热部署了。

最近在学习java agent,需要在生成的jar包里面的 META-INF/MAINIFEST.MF 必须包含 Premain-Class这个属性。采用MAVEN的maven-jar-plugin插件完成。

maven-jar-plugin插件默认生成的MAINIFEST.MF文件包含以下几项:

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: ${user.name}
Build-Jdk: ${java.version}
现在要新增一个Premain-Class属性,配置如下:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<Premain-Class>
com.xzq.test.PreAgent
</Premain-Class>
</manifestEntries>
</archive>
</configuration>

spring boot maven META-INF/MAINIFEST.MF的更多相关文章

  1. Spring Boot Maven Plugin(一):repackage目标

    简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...

  2. Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class

    [背景]spring-boot项目,打包成可执行jar,项目内有两个带有main方法的类并且都使用了@SpringBootApplication注解(或者另一种情形:你有两个main方法并且所在类都没 ...

  3. Spring Boot Maven Plugin(二):run目标

    简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...

  4. 微服务下 Spring Boot Maven 工程依赖关系管理

    单体 Spring Boot Maven 工程 最基本的 pom.xml 包含工程信息.Spring Boot 父工程.属性配置.依赖包.构建插件 <?xml version="1.0 ...

  5. Spring Boot的Maven插件Spring Boot Maven plugin详解

    Spring Boot的Maven插件(Spring Boot Maven plugin)能够以Maven的方式为应用提供Spring Boot的支持,即为Spring Boot应用提供了执行Mave ...

  6. Spring boot+ maven + thymeleaf + HTML 实现简单的web项目

    第一步: 创建一个SpringBoot应用 第二步: 创建一个实体,用来存储数据,在src/main/java/com/example/first下创建包entity , 在entity下创建Pers ...

  7. spring boot maven打包可运行jar包

    普通打包之后在程序目录运行,或者编写bat运行时会提示“没有主清单属性”,这是因为并没有找到main()方法,需要我们指明告诉java程序 我bat中的代码 @echo off title mytit ...

  8. 一步步搭建 Spring Boot maven 框架的工程

    摘要:让Spring应用从配置到运行更加快速,演示DIY Spring Boot 框架时,如何配置端口号,如何添加日志. Spring Boot 框架帮助开发者更容易地创建基于Spring的应用程序和 ...

  9. Spring Boot Maven 打包 Jar

    Maven pom.xml 必须包含 <packaging>jar</packaging> <build> <plugins> <plugin&g ...

随机推荐

  1. 这些APP开发技巧可少花60万!

    用户需求——我偏不用干嘛要装? 随着手机的普及,大众流量的端口从电脑转移到手机,传统的商业平台从线下到电脑再到手机进行了转换.手机APP作为移动互联网的入口,众多创业者凭借一个手机APP成就了亿万财富 ...

  2. 【Vegas原创】SQLServer2008防小人利器:审核/审计功能

    小人见怪不怪,世界上最可怕的就是会技术的小人,防不胜防! sa密码泄露也就算了,关键是人家也可以前台攻击,直接把你弄的没辙! 在诅咒这种小人的同时,除了加强服务器安全管理,密码策略等,SQL Serv ...

  3. Python时间,日期,时间戳之间转换,时间转换时间戳,Python时间戳转换时间,Python时间转换时间戳

    #1.将字符串的时间转换为时间戳方法: a = "2013-10-10 23:40:00" #将其转换为时间数组 import time timeArray = time.strp ...

  4. 亚马逊免费EC2搭建OpenVPN

    系统选择Ubuntu 16.04.5 LTS 1.下载OpenVPN AS 2.1.4 64位版本 sudo wget http://swupdate.openvpn.org/as/openvpn-a ...

  5. idea maven 集成多模块 module

    首先第一步创建 顶级项目  也就是父项目 在创面那部中 不管你勾不勾 create from 那个选项 都无所谓,最终创建的项目要全删的 ,只保留pom.xml 父项目结构 接下来 创建子项目  也是 ...

  6. 【java】[文件上传jar包]commons-fileUpload组件解决文件上传(文件名)乱码问题

    response.setContentType("text/html; charset=UTF-8");  Boolean isMultipart = ServletFileUpl ...

  7. C语言 · 积分之迷

    标题:积分之迷 小明开了个网上商店,卖风铃.共有3个品牌:A,B,C. 为了促销,每件商品都会返固定的积分. 小明开业第一天收到了三笔订单: 第一笔:3个A + 7个B + 1个C,共返积分:315 ...

  8. Centos7 Mysql5.7主从服务器配置

    在两台Linux机器上安装MySQL 一.Master主服务器配置1.编辑my.cnf(命令查找文件位置:find / -name my.cnf)vi /etc/mysql/my.cnf 在[mysq ...

  9. http 请求 post get 长度限制

    一.问题起因在某项目释放后Bug统计的附件<释放后问题>里有:   问题  原因  分析  备注  CSV处理时,如果处理的主题数过多,发生URL参数上限的错误:  可变长度的参数通过UR ...

  10. window/linux composer安装/卸载

    packagist库:https://packagist.org/ window  安装 参考地址:https://www.kancloud.cn/thinkphp/composer/35668 1. ...