1. touch MANIFEST.MF

1. touch META-INF/MANIFEST.MF

2. vim MANIFEST.MF

Main-Class: com.mypackage.MyClass

Maven

<build>
  <plugins>
    <plugin>
      <!-- Build an executable JAR -->
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-jar-plugin</artifactId>
      <version>3.1.0</version>
      <configuration>
        <archive>
          <manifest>
            <addClasspath>true</addClasspath>
            <classpathPrefix>lib/</classpathPrefix>
            <mainClass>com.mypackage.MyClass</mainClass>
          </manifest>
        </archive>
      </configuration>
    </plugin>
  </plugins>
</build>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2021-08-27
  • 2021-07-27
猜你喜欢
  • 2022-12-23
  • 2021-10-31
  • 2021-11-23
  • 2022-12-23
  • 2021-05-15
  • 2021-05-04
相关资源
相似解决方案