当前位置:网站首页>Jar runs with error no main manifest attribute

Jar runs with error no main manifest attribute

2022-07-06 10:02:00 Learn from Tao Ge

jar Operation error reporting no main manifest attribute
 Insert picture description here

solve

After investigation, it was found that maven In the project pom.xml No addition

<packaging>jar</packaging>

And the following configurations :

<build>
<!--maven The package of plug-ins -->
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
  <resources>
  <!-- pom.xml Add resources To configure  -->
    <resource>
      <directory>src/main/java</directory>
      <includes>
        <include>**/*.properties</include>
      </includes>
    </resource>
    <resource>
      <!--  The project will be packaged with java In the directory *.xml Files are also packaged  -->
      <directory>src/main/resources</directory>
    </resource>
    <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <filtering>false</filtering>
            </resource>
  </resources>
</build>

Reference resources

  1. jar Operation error reporting no main manifest attribute
  2. 【 The micro service items are manually marked jar package & solve Maven Lost when packing properties Documentation issues 】
原网站

版权声明
本文为[Learn from Tao Ge]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060905237948.html