zoukankan      html  css  js  c++  java
  • 【JAVA】idea maven quickstart 项目打包 提示没有“没有主清单属性”

    修改pom.xml,可将项目创建时自动生成的默认plugs删除(idea侧边栏都有这项plug,所有不会影响使用),打包后的jar名字是mian类的名字

    <build>
            <finalName>App</finalName>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.1</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                            <configuration>
                                <transformers>
                                    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                        <mainClass>pres.ndz.simple.App</mainClass>
                                    </transformer>
                                </transformers>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    
    “年轻时,我没受过多少系统教育,但什么书都读。读得最多的是诗,包括烂诗,我坚信烂诗早晚会让我邂逅好诗。” by. 马尔克斯
  • 相关阅读:
    gdb 调试器的使用
    vi 的基本操作
    Makefile
    gcc
    动态内存分配
    Linux常用命令
    文件基本操作
    linux的启动配置文件(grub)
    Hello IT
    Val简介(来源维基百科)
  • 原文地址:https://www.cnblogs.com/jzsg/p/10887227.html
Copyright © 2011-2022 走看看