snazy commented on PR #785:
URL: https://github.com/apache/polaris/pull/785#issuecomment-2593367801

   Well, it actually works from an included-build :)
   
   The below patch, running `./gradlew :polaris-quarkus-server:demoTest --info` 
shows the Polaris server starting up (and being shutdown).
   
   ```patch
   diff --git a/quarkus/server/build.gradle.kts 
b/quarkus/server/build.gradle.kts
   index 83e94435d..94f39b026 100644
   --- a/quarkus/server/build.gradle.kts
   +++ b/quarkus/server/build.gradle.kts
   @@ -17,14 +17,22 @@
     * under the License.
     */
    
   +import io.quarkus.gradle.tasks.QuarkusBuild
   +
    plugins {
      alias(libs.plugins.quarkus)
      alias(libs.plugins.openapi.generator)
      id("polaris-server")
      id("polaris-license-report")
      id("distribution")
   +  id("org.apache.polaris.apprunner")
    }
    
   +val quarkusRunner by
   +  configurations.creating {
   +    description = "Used to reference the generated runner-jar (either 
fast-jar or uber-jar)"
   +  }
   +
    dependencies {
      implementation(project(":polaris-core"))
      implementation(project(":polaris-api-management-service"))
   @@ -38,6 +46,8 @@ dependencies {
    
      // override dnsjava version in dependencies due to 
https://github.com/dnsjava/dnsjava/issues/329
      implementation(platform(libs.dnsjava))
   +
   +  polarisQuarkusServer(project(":polaris-quarkus-server", "quarkusRunner"))
    }
    
    quarkus {
   @@ -71,3 +81,44 @@ distributions {
        }
      }
    }
   +
   +testing {
   +  suites {
   +    val demoTest by registering(JvmTestSuite::class)
   +  }
   +}
   +
   +val quarkusFatJar = project.hasProperty("uber-jar")
   +val quarkusBuild = tasks.named<QuarkusBuild>("quarkusBuild")
   +
   +// Expose runnable jar via quarkusRunner configuration for 
integration-tests that require the
   +// server.
   +artifacts {
   +  add(
   +    quarkusRunner.name,
   +    provider {
   +      if (quarkusFatJar) quarkusBuild.get().runnerJar
   +      else quarkusBuild.get().fastJar.resolve("quarkus-run.jar")
   +    },
   +  ) {
   +    builtBy(quarkusBuild)
   +  }
   +}
   +
   +// Add the uber-jar, if built, to the Maven publication
   +if (quarkusFatJar) {
   +  afterEvaluate {
   +    publishing {
   +      publications {
   +        named<MavenPublication>("maven") {
   +          artifact(quarkusBuild.get().runnerJar) {
   +            classifier = "runner"
   +            builtBy(quarkusBuild)
   +          }
   +        }
   +      }
   +    }
   +  }
   +}
   +
   +polarisQuarkusApp { includeTask(tasks.named("demoTest")) }
   diff --git a/quarkus/server/src/demoTest/java/foo/DemoTest.java 
b/quarkus/server/src/demoTest/java/foo/DemoTest.java
   new file mode 100644
   index 000000000..e2e2dd81a
   --- /dev/null
   +++ b/quarkus/server/src/demoTest/java/foo/DemoTest.java
   @@ -0,0 +1,27 @@
   +/*
   + * Licensed to the Apache Software Foundation (ASF) under one
   + * or more contributor license agreements.  See the NOTICE file
   + * distributed with this work for additional information
   + * regarding copyright ownership.  The ASF licenses this file
   + * to you under the Apache License, Version 2.0 (the
   + * "License"); you may not use this file except in compliance
   + * with the License.  You may obtain a copy of the License at
   + *
   + *   http://www.apache.org/licenses/LICENSE-2.0
   + *
   + * Unless required by applicable law or agreed to in writing,
   + * software distributed under the License is distributed on an
   + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   + * KIND, either express or implied.  See the License for the
   + * specific language governing permissions and limitations
   + * under the License.
   + */
   +
   +package foo;
   +
   +import org.junit.jupiter.api.Test;
   +
   +public class DemoTest {
   +    @Test
   +    public void test() {}
   +}
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to