no main manifest attribute, in demo-1.0.jar
今天想打包一个jar到Linux上运行,发现使用java -jar demo-1.0.jar 运行报错:
no main manifest attribute, in demo-1.0.jar
解决方案:
在maven的pom.xml中添加以下配置就可以
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<mainClass>com.sf.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
no main manifest attribute, in demo-1.0.jar的更多相关文章
- 【Azure Developer】记录一次使用Java Azure Key Vault Secret示例代码生成的Jar包,单独运行出现 no main manifest attribute, in target/demo-1.0-SNAPSHOT.jar 错误消息
问题描述 创建一个Java Console程序,用于使用Azure Key Vault Secret.在VS Code中能正常Debug,但是通过mvn clean package打包为jar文件后, ...
- 【spring cloud】【IDEA】【Maven】spring cloud多模块打包,打包的jar包只有几k,jar包无法运行,运行报错:no main manifest attribute, in /ms-eureka.jar
======================================================================================== 引申:maven打包多 ...
- 【Maven篇】---解决Maven线上部署java.lang.ClassNotFoundException和no main manifest attribute解决方法
一.前述 maven 线上部署的话会出现一些问题比如java.lang.ClassNotFoundException或者no main manifest attribute的话,是因为maven 配置 ...
- no main manifest attribute, in testProject-1.0-SNAPSHOT.jar
no main manifest attribute, in testProject-1.0-SNAPSHOT.jar 错误描述: no main manifest attribute, in tes ...
- docker运行spring boot 包镜像出现no main manifest attribute问题
问题: 在进行docker部署的时候,开始对项目进行打包,在启动该镜像时 [root@topcheer docker]# docker run -it 00494e3d4550no main mani ...
- 启动servlet报错:The servlets named [DemoServlet] and [main.java.com.wlf.demo.servlet.DemoServlet] are both mapped to the url-pattern [/hello] which is not permitted
先看具体错误日志: [2019-04-26 09:29:25,484] Artifact demo-servlet:war: Artifact is being deployed, please wa ...
- 【iCore3 双核心板】DEMO 1.0 测试程序发布
iCore3 Demo V1.0 程序说明 一.概要 本资料包包含5个文件夹: 1.“arm”里是 icore3上 arm的程序包,开发环境为 KEIL 5.17: 2.“fpga”里是 icore3 ...
- 【iCore4 双核心板】DEMO V1.0 测试程序发布
iCore4 Demo V1.0程序说明 一.概要 本资料包含5个文件夹: 1.“arm”里是iCore4上arm的程序包,开发环境为KEIL5.17: 2.“fpga”里是iCore4上FPGA的程 ...
- 【iCore1S 双核心板】DEMO V1.0 测试程序发布
iCore1S Demo V1.0程序说明 一.概要 本资料包含5个文件夹: 1.“ARM”里是iCore1S上ARM的程序包,开发环境为KEIL5.17: 2.“FPGA”里是iCore1S上FPG ...
随机推荐
- Bootstrap历练实例:带表格的面板
带表格的面板 为了在面板中创建一个无边框的表格,我们可以在面板中使用 class .table.假设有个 <div> 包含 .panel-body,我们可以向表格的顶部添加额外的边框用来分 ...
- FMDB中的数据处理
[self.db executeUpdate:@"create table test (a text, b text, c integer, d double, e double)" ...
- bash编程之循环控制:
bash编程之循环控制: for varName in LIST; do 循环体 done while CONDITION; do 循环体 done until CONDITION; do 循 ...
- css3中的nth-child和nth-of-type的区别
实例: 首先创建一个HTML结构 <div class="post"> <p>我是文章的第一段落</p> <p>我是文章的第二段落& ...
- [提供可行性脚本] RHEL/CentOS 7 多节点SSH免密登陆
实验说明: 在自动化部署时,会经常SSH别的机器去操作,然而每次的密码认证却很令人烦躁,尤其是很长的密码,因此SSH免密登陆就显得必不可少: 在机器数目很多的时候,使用更过的往往是Ansible分发并 ...
- vue渲染函数&JSX
Vue推荐在绝大多数情况下使用template来创建你的HTML.然而在一些场景中,你真的需要JavaScript的完全编程能力,这时你可以使用render函数,它比template跟接近编译器. 虚 ...
- 7.Yii2.0框架自定义全局工具函数
功能: 新建共用方法的打印方法,可以很方便的格式化打印 一.新建helper/function.php <?php /** * Created by Haima. * Author:Haima ...
- hdu 6301
Distinct Values Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)T ...
- Mysql进入数据库
进入某个数据库: use db_name; //db_name为数据库名称 mysql> use db_name Database changed
- 如何将Python对象保存在本地文件中?
Python对象的永久存储 1.使用Python的pickle模块 import pickle class A: def __init__(self,name,a): self.name=name s ...