Maven Jar Builder: Could not find or load main class

前端 未结 4 1234
谎友^
谎友^ 2020-12-19 13:57

I have been trying for several days now to create an executable jar file for my muli-module maven project. However, when I try to run this jar file I get \"Could not find or

4条回答
  •  温柔的废话
    2020-12-19 14:40

    I'm going to necro this post because it is important to have 3 different things set properly:

    1. MainClass.java needs to be in /src/main/java/com/domain/project/
    2. Maven assembly plugin needs com.domain.project.MainClass
    3. Your package should be set to com.domain.project

    When those three match, Maven should package an executable JAR file.

提交回复
热议问题