亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

解決Maven打包只有幾十K,運(yùn)行報(bào)錯(cuò)no main manifest attribute問題

 更新時(shí)間:2024年06月15日 10:19:45   作者:時(shí)間是一種解藥  
這篇文章主要介紹了解決Maven打包只有幾十K,運(yùn)行報(bào)錯(cuò)no main manifest attribute問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

問題背景

上午打包還好好的,下午就報(bào)錯(cuò)了:

no main manifest attribute

解決方案

1.這個(gè)時(shí)候去看一下jar的大小

你會(huì)發(fā)現(xiàn),原來是有幾十KB,所以不能啟動(dòng)


2.主要是出在maven的問題上

寫法方式是父類模塊和子模塊都引入了Maven插件

需要把父類模塊的maven插件給去掉

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.0</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>cn.plus</groupId>
    <artifactId>server</artifactId>
    <version>0.0.1</version>
    <packaging>pom</packaging>

    <modules>
        <module>common</module>
        <module>p</module>
        <module>j</module>
        <module>ap</module>
    </modules>

    <build>
        <plugins>
<!--            <plugin>-->
<!--                <groupId>org.springframework.boot</groupId>-->
<!--                <artifactId>spring-boot-maven-plugin</artifactId>-->
<!--                <configuration>-->
<!--                    <classifier>bootJar</classifier>-->
<!--                    <mainClass>cn.catalystplus.facade.Application</mainClass>-->
<!--                    <outputDirectory>${project.build.directory}/root</outputDirectory>-->
<!--                    <excludes>-->
<!--                        <exclude>-->
<!--                            <groupId>org.projectlombok</groupId>-->
<!--                            <artifactId>lombok</artifactId>-->
<!--                        </exclude>-->
<!--                    </excludes>-->
<!--                </configuration>-->
<!--                <executions>-->
<!--                    <execution>-->
<!--                        <goals>-->
<!--                            <goal>repackage</goal>-->
<!--                        </goals>-->
<!--                    </execution>-->
<!--                </executions>-->
<!--            </plugin>-->
        </plugins>
    </build>
</project>

總結(jié)

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論