无法找到主要类:bootRepackage [英] Unable to find main class :bootRepackage

查看:446
本文介绍了无法找到主要类:bootRepackage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的gradle构建出了问题。我使用Spring网站提出的标准( https://spring.io/guides/gs/ rest-service / ),但当我尝试使用gradle构建时,出现此错误:



它不适用于此gradle,但是当我使用另一个当我在学校时)它完美地工作。

解决方案

有两种可能性:


  1. 你的源代码目录不在正确的位置(使用sourceSets指令来解决这个问题,你的源代码目录应该类似于 src / main / java / your / package

  2. 加上这个来表示你的主类在哪里

    springBoot {
    mainClass =hello.FileUploader
    }


我确定它是1。


I got a problem with my gradle build. I use the standard proposed by the Spring Website (https://spring.io/guides/gs/rest-service/), but when I try to use gradle build, I got this error :

It doesnt work for this gradle, but when I use another one (that I took when I was at school) it work perfectly.

解决方案

There are two possibilities

  1. Your source directory is not in the right location (use the sourceSets directive to fix this. your source directory should resemble something like src/main/java/your/package)
  2. Add this to indicate where your main class is

    springBoot { mainClass = "hello.FileUploader" }

I am pretty sure it is 1.

这篇关于无法找到主要类:bootRepackage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆