釋出您的應用程式

使用 Maven-publish 外掛釋出

要釋出你的 Spring Boot jar 或 war,請使用 MavenPublication 上的 artifact 方法將其新增到釋出中。將生成你要釋出的構件的任務傳遞給 artifact 方法。例如,要釋出由預設 bootJar 任務生成的構件

  • Groovy

  • Kotlin

publishing {
	publications {
		bootJava(MavenPublication) {
			artifact tasks.named("bootJar")
		}
	}
	repositories {
		maven {
			url = 'https://repo.example.com'
		}
	}
}
publishing {
	publications {
		create<MavenPublication>("bootJava") {
			artifact(tasks.named("bootJar"))
		}
	}
	repositories {
		maven {
			url = uri("https://repo.example.com")
		}
	}
}

使用應用程式外掛分發

當應用 application 外掛 時,將建立一個名為 boot 的分發。此分發包含由 bootJarbootWar 任務生成的存檔以及在類 Unix 平臺和 Windows 上啟動它的指令碼。Zip 和 tar 分發分別可以透過 bootDistZipbootDistTar 任務構建。要使用 application 外掛,其 mainClassName 屬性必須配置為你的應用程式主類的名稱。

© . This site is unofficial and not affiliated with VMware.