@@ -28,6 +28,14 @@ plugins {
2828 id(" distribution" )
2929}
3030
31+ val runScript by configurations.creating { description = " Used to reference the run.sh script" }
32+
33+ val distributionZip by
34+ configurations.creating { description = " Used to reference the distribution zip" }
35+
36+ val distributionTar by
37+ configurations.creating { description = " Used to reference the distribution tarball" }
38+
3139dependencies {
3240 implementation(project(" :polaris-core" ))
3341 implementation(project(" :polaris-version" ))
@@ -53,10 +61,12 @@ dependencies {
5361
5462 testRuntimeOnly(project(" :polaris-eclipselink" ))
5563 testRuntimeOnly(" org.postgresql:postgresql" )
64+
65+ runScript(project(" :polaris-quarkus-run-script" , " runScript" ))
5666}
5767
5868quarkus {
59- quarkusBuildProperties.put(" quarkus.package.type" , " uber -jar" )
69+ quarkusBuildProperties.put(" quarkus.package.type" , " fast -jar" )
6070 // Pull manifest attributes from the "main" `jar` task to get the
6171 // release-information into the jars generated by Quarkus.
6272 quarkusBuildProperties.putAll(
@@ -72,28 +82,48 @@ quarkus {
7282 )
7383}
7484
75- publishing {
76- publications {
77- named<MavenPublication >(" maven" ) {
78- val quarkusBuild = tasks.getByName<QuarkusBuild >(" quarkusBuild" )
79- artifact(quarkusBuild.runnerJar) {
80- classifier = " runner"
81- builtBy(quarkusBuild)
82- }
85+ distributions {
86+ main {
87+ contents {
88+ from(runScript)
89+ from(project.layout.buildDirectory.dir(" quarkus-app" ))
90+ from(" ../../NOTICE" )
91+ from(" ../../LICENSE-BINARY-DIST" ).rename(" LICENSE-BINARY-DIST" , " LICENSE" )
8392 }
8493 }
8594}
8695
87- tasks.named( " distZip " ) { dependsOn( " quarkusBuild" ) }
96+ val quarkusBuild = tasks.named< QuarkusBuild >( " quarkusBuild" )
8897
89- tasks.named(" distTar" ) { dependsOn(" quarkusBuild" ) }
98+ val distTar =
99+ tasks.named<Tar >(" distTar" ) {
100+ dependsOn(quarkusBuild)
101+ // Trigger resolution (and build) of the run-script artifact
102+ inputs.files(runScript)
103+ compression = Compression .GZIP
104+ }
90105
91- distributions {
92- main {
93- contents {
94- from(" ../../NOTICE" )
95- from(" ../../LICENSE-BINARY-DIST" ).rename(" LICENSE-BINARY-DIST" , " LICENSE" )
96- from(project.layout.buildDirectory) { include(" polaris-quarkus-admin-*-runner.jar" ) }
106+ val distZip =
107+ tasks.named<Zip >(" distZip" ) {
108+ dependsOn(quarkusBuild)
109+ // Trigger resolution (and build) of the run-script artifact
110+ inputs.files(runScript)
111+ }
112+
113+ // Expose runnable jar via quarkusRunner configuration for integration-tests that require the
114+ // server.
115+ artifacts {
116+ add(distributionTar.name, provider { distTar.get().archiveFile }) { builtBy(distTar) }
117+ add(distributionZip.name, provider { distZip.get().archiveFile }) { builtBy(distZip) }
118+ }
119+
120+ afterEvaluate {
121+ publishing {
122+ publications {
123+ named<MavenPublication >(" maven" ) {
124+ artifact(distTar.get().archiveFile) { builtBy(distTar) }
125+ artifact(distZip.get().archiveFile) { builtBy(distZip) }
126+ }
97127 }
98128 }
99129}
0 commit comments