相关疑难解决方法(0)

如何告诉Spring Boot哪个主类用于可执行jar?

Execution default of goal 
org.springframework.boot:spring-boot-maven-plugin:1.0.1.RELEASE:repackage 
failed: 
Unable to find a single main class from the following candidates
Run Code Online (Sandbox Code Playgroud)

我的项目有多个带有main方法的类.我如何告诉Spring Boot Maven插件它应该用作哪个类作为主类?

java spring executable-jar maven spring-boot

168
推荐指数
7
解决办法
16万
查看次数

Maven错误:无法找到或加载主类

我正在使用Java Maven程序而且我不知道要输入什么<mainClass>.我已经根据众多 stackoverflow问题尝试了各种各样的东西,但他们没有解决错误.

每次说:

Maven Error: Could not find or load main class ...
Run Code Online (Sandbox Code Playgroud)

我在里面写了这个pom.xml(减去???)

  <build>
  ...
  <plugins>
  ...
    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
            <descriptors>
                <descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
            </descriptors>
            <archive>
                <manifest>
                    <mainClass> ??? </mainClass>
                </manifest>
            </archive>
        </configuration>
        <executions>
            <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
                <goal>single</goal>
            </goals>
            </execution>
        </executions>
    </plugin>
  ...
  </plugins>
  ...
  </build>
Run Code Online (Sandbox Code Playgroud)

我该如何解决这些错误?

java maven-2 program-entry-point jar manifest

31
推荐指数
6
解决办法
8万
查看次数