spring boot maven META-INF/MAINIFEST.MF
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的更多相关文章
- Spring Boot Maven Plugin(一):repackage目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- Spring Boot Maven Plugin打包异常及三种解决方法:Unable to find main class
[背景]spring-boot项目,打包成可执行jar,项目内有两个带有main方法的类并且都使用了@SpringBootApplication注解(或者另一种情形:你有两个main方法并且所在类都没 ...
- Spring Boot Maven Plugin(二):run目标
简介 Spring Boot Maven Plugin插件提供spring boot在maven中的支持.允许你打包可运行的jar包或war包. 插件提供了几个maven目标和Spring Boot ...
- 微服务下 Spring Boot Maven 工程依赖关系管理
单体 Spring Boot Maven 工程 最基本的 pom.xml 包含工程信息.Spring Boot 父工程.属性配置.依赖包.构建插件 <?xml version="1.0 ...
- Spring Boot的Maven插件Spring Boot Maven plugin详解
Spring Boot的Maven插件(Spring Boot Maven plugin)能够以Maven的方式为应用提供Spring Boot的支持,即为Spring Boot应用提供了执行Mave ...
- Spring boot+ maven + thymeleaf + HTML 实现简单的web项目
第一步: 创建一个SpringBoot应用 第二步: 创建一个实体,用来存储数据,在src/main/java/com/example/first下创建包entity , 在entity下创建Pers ...
- spring boot maven打包可运行jar包
普通打包之后在程序目录运行,或者编写bat运行时会提示“没有主清单属性”,这是因为并没有找到main()方法,需要我们指明告诉java程序 我bat中的代码 @echo off title mytit ...
- 一步步搭建 Spring Boot maven 框架的工程
摘要:让Spring应用从配置到运行更加快速,演示DIY Spring Boot 框架时,如何配置端口号,如何添加日志. Spring Boot 框架帮助开发者更容易地创建基于Spring的应用程序和 ...
- Spring Boot Maven 打包 Jar
Maven pom.xml 必须包含 <packaging>jar</packaging> <build> <plugins> <plugin&g ...
随机推荐
- NOIP2010普及组 三国游戏
题目OJ地址 http://codevs.cn/problem/1129/ https://www.luogu.org/problemnew/show/P1199 题目描述 Description 小 ...
- github上总结的python资源列表【转】
Python 资源大全中文版 我想很多程序员应该记得 GitHub 上有一个 Awesome - XXX 系列的资源整理.awesome-python 是 vinta 发起维护的 Python 资源列 ...
- springboot更换日志系统
背景:springboot.2.1.2默认使用logback作为日志系统,我想禁用logback,换成效率更高的log4j2. 一.去除默认的logback依赖 1. 方法一 精准去除 depende ...
- ubuntu代理设置
很多时候,服务器都没有连接外部互联网的条件,需要利用代理服务器才能够访问外网资源进行软件包的升级: ubuntu修改apt-get的代理可以使用代理进行安装包的升级: ubuntu@ubuntu:~$ ...
- 构建基于Suricata+Splunk的IDS入侵检测系统
一.什么是IDS和IPS? IDS(Intrusion Detection Systems):入侵检测系统,是一种网络安全设备或应用软件,可以依照一定的安全策略,对网络.系统的运行状况进行监视,尽可能 ...
- oracle学习创建和准备Oracle样例数据库
此处有一个Oracle创建数据库和表和插入数据的脚本: http://www.forta.com/books/0672336073/
- JVM:Java常见内存溢出异常分析
转载自:http://www.importnew.com/14604.html Java虚拟机规范规定JVM的内存分为了好几块,比如堆,栈,程序计数器,方法区等,而Hotspot jvm的实现中,将堆 ...
- nohup.out文件过大解决方法 定时任务清空
0.1和2分别表示标准输入.标准输出和标准错误信息输出,可以用来指定需要重定向的标准输入或输出. 在一般使用时,默认的是标准输出,既1.当我们需要特殊用途时,可以使用其他标号.例如,将某个程序的错误信 ...
- HTTP缓存及其合理使用
以前以为HTTP缓存是个简单的事,项目中遇到后才发觉关于缓存实践有挺深的学问. from几篇文章详见: 使用 HTTP 缓存:Etag, Last-Modified 与 Cache-Control 合 ...
- python 读取mysql数据至csv文件中,并发送邮件
test 代码: #coding:utf-8 ''' Created on 2019年2月18日 @author: Administrator ''' import ConfigParser impo ...