我在春季编写的API jar出现了问题。
问题是每次我尝试运行docker映像时,错误是:“ myFile.jar中没有主清单属性”
必须在我的RaspBerry pi上部署API
我分享一些细节->
build.gradle
plugins {
id 'org.springframework.boot' version '2.1.6.RELEASE'
id 'java'
}
apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
group = 'me.myddns.findyourhome'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '12'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-dependencies:2.0.5.RELEASE'
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
springBoot {
mainClassName = 'me.myddns.findyourhome.ApiDispatcher'
}
(me.myddns.findyourhome.ApiDispatcher是主类文件夹的名称,我尝试添加.MainFileName,但没有任何变化)
Dockerfile
FROM hypriot/rpi-java
ADD ApiDispatcher.jar /Users/giuseppediciolla/Desktop/api/ApiDispatcher.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "/Users/giuseppediciolla/Desktop/api/ApiDispatcher.jar"]
我不知道错误的出处,因此,如果您需要其他详细信息来帮助我,请告诉我。
提前谢谢!