文章目录

原来普通的jar包一直是

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>1.2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <!--程序入口类,main方法类-->
                                    <mainClass>com.leesin.CSDN</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

之后一直报错

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:1.2.1:shade (default) on project sc-hsf-provider: Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:1.2.1:shade for parameter resource: Cannot find 'resource' in class org.apache.maven.plugins.shade.resource.ManifestResourceTransformer -> [Help 1]

原来SpringBoot的设置主清单属性和普通的不一样

<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- 工程主入口-->
                    <mainClass>com.aliware.edas.HSFConsumerApplication</mainClass>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

SpringBoot通过maven打包成jar,设定主清单属性。的更多相关文章

  1. 初次学习DropWizard框架——解决maven打包时出现没有主清单属性的问题

    笔者因为公司的项目需要,开始接触DropWizard框架,照着官网https://www.dropwizard.io/0.9.2/docs/getting-started.html撸了一遍. 工具为I ...

  2. IntelliJ IDEA 2017 创建SpringBoot项目, 及.jar没有主清单属性解决办法

    1. 创建项目:  File >> New >> Spring Initializr  选好 SDK, 及 依赖包(比如 Web >> Web ) .   需要使用 ...

  3. eclipse 导出jar 没有主清单属性的解决方法

    eclipse编写导出的jar文件,运行出现了没有主清单属性,问题在哪里呢?有下面几种方法: 1. 导出jar文件的时候选择[可运行的jar文件]而不是[Jar文件]即可,如下图: 2. 在jar文件 ...

  4. Maven打包成Jar文件时依赖包的问题

    我们项目中使用到第三方的库文件,这些jar库文件并没有放到Maven中央库上,导致我们需要在项目中自己配置使用.我们的两三个开发人员对Java都是很熟,因此在使用中遇到了一些问题,表现在:在本地中引入 ...

  5. maven 打包成 .jar 文件执行:没有主清单属性错误

    报错原因是pom.xml配置文件中没有指定main入口信息,在pom.xml文件中添加如下代码: <build> <plugins> <plugin> <gr ...

  6. [DEBUG] spring boot在eclipse中用maven打包成jar访问templates报500错误

    更新:打war包的话只要把html文件放在resources/templates下即可,根本不需要放外面. 配置application.yml和templates放外面这种做法,打war包确实不行. ...

  7. Spring Boot 使用maven打包成jar

    1.application.properties加入如下配置 server.port= 2.修改pom.xml <?xml version="1.0" encoding=&q ...

  8. 部署springboot项目时 打包成jar时包中html,js,css文件缺失

    问题 打包出来的jar包里面没有html,js,css文件 解决方案 在pom.xml文件下的build选项中的src/main/resources的目录下 添加配置 <build> &l ...

  9. maven打包成jar

    maven pom.xml中添加依赖 <build> <plugins> <plugin> <groupId>org.apache.maven.plug ...

随机推荐

  1. 每天一个Linux命令:ls(1)

    ls ls命令用于显示指定工作目录下之内容(列出目前工作目录所含之文件及子目录). 格式 ls [-alrtAFR] [name...] 参数选项 参数 备注 -a 列出目录下的所有文件,包括以 . ...

  2. QT之QCustomPlot(一)

    QDetectPlot::QDetectPlot(QWidget *parent) : QCustomPlot(parent) { QVector<), y(); // initialize w ...

  3. FFT快速傅里叶模板

    FFT快速傅里叶模板…… /* use way: assign : h(x) = f(x) * g(x) f(x):len1 g(x):len2 1. len = 1; while(len < ...

  4. Anaconda配置

    0x00 下载 为了更快的下载,可以到清华开源软件镜像站下载 地址:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 在此以Anaconda ...

  5. (转)Linux C 多线程编程----互斥锁与条件变量

    转:http://blog.csdn.net/xing_hao/article/details/6626223 一.互斥锁 互斥量从本质上说就是一把锁, 提供对共享资源的保护访问. 1. 初始化: 在 ...

  6. windows10自动更新好烦啊

    cmd下输入services.msc,找到windows update,把手动变成禁用. https://blog.csdn.net/hwzzyr/article/details/81190442 h ...

  7. C#调用Mail发送QQ邮件

    需要用到: 1.System.Net.Mail; 2.QQ邮箱的POP3/SMTP服务码 QQ邮箱的POP3/SMTP服务码获取方法: 1.打开qq邮箱: 2.进入设置页面-->账户:(往下翻) ...

  8. Java-Class-FC:java.lang.StringBuilder

    ylbtech-Java-Class-FC:java.lang.StringBuilder 1.返回顶部   2.返回顶部 1. @Override public String toString() ...

  9. webpack中代理配置(proxyTable)

    注:用axios请求 1,下载axios npm i axios --save 2,在config文件下的index.js中配置代理地址 参考:https://vuejs-templates.gith ...

  10. 拾遗:nmcli 连接 wifi

    ... nmcli device wifi list nmcli device wifi connect SSID password PASSWORD ...