quarkus

How can I get the version of the application (defined by tag version im pom) in quarkus specially?

 ̄綄美尐妖づ 提交于 2020-01-06 06:10:37
问题 I moved from a plain Java EE application to quarkus.io. In Java EE I had the a properties file with version=${project.version} and reeading this file in an JAX RS endpoint. This worked very well. @GET public Response getVersion() throws IOException { InputStream in = getClass().getClassLoader().getResourceAsStream("buildInfo.properties"); if (in == null) { return Response.noContent().build(); } Properties props = new Properties(); props.load(in); JsonObjectBuilder propertiesBuilder = Json

How can I get the version of the application (defined by tag version im pom) in quarkus specially?

流过昼夜 提交于 2020-01-06 06:10:01
问题 I moved from a plain Java EE application to quarkus.io. In Java EE I had the a properties file with version=${project.version} and reeading this file in an JAX RS endpoint. This worked very well. @GET public Response getVersion() throws IOException { InputStream in = getClass().getClassLoader().getResourceAsStream("buildInfo.properties"); if (in == null) { return Response.noContent().build(); } Properties props = new Properties(); props.load(in); JsonObjectBuilder propertiesBuilder = Json

QUARKUS quarkusBuild uber jar to specific location

余生长醉 提交于 2020-01-06 04:50:16
问题 From the doc here. If I property quarkus.package.uber-jar=true then if I build . ./gradlew clean quarkusBuild I got both: 1. /myapp/build/libs/my-app.jar (no sure what is the use of it with no deps, no lib/ folder created) 2 /my/app/build/my-app-runner.jar Q: how would I control the name of the runner.jar and the location? (say I would like to put it to libs/ too) UPDATE: Tried adding new task that would copy the Uber jar to /libs after quarkusBuild has finished task quarkusUberToLibs() {

Quarkus project once covered to mutli-module form got 404 when hit the existing endpoints

感情迁移 提交于 2019-12-24 19:29:19
问题 quarkus.version :1.0.1.Final Used to have working quarkus web project with rest-easy end-points. Converted it to multi-module one. Still use maven . This way: my-project-service - my-project-api - data-api-object.java - pom.xml // dep on `quarkus-core` as `provided` - my-project-backend - pom.xml + depends on my-project-api - pom.xml // managed dependencies defined Similar to this example, actually. All compiles and runs. ./mvnw compile quarkus:dev I see log: - [io.quarkus] (main) Quarkus 1.0

Quarkus RestEasy ws.rs Resource, CompletionStage exception handling

纵然是瞬间 提交于 2019-12-24 18:41:32
问题 If I defined my rest-easy Resource this this way: @GET @Path("/stuff") @Produces(MediaType.APPLICATION_JSON) public Response getStuff() { final Single<Stuff> stuffSingle = stuffService.getStuffAsync(); return Response.ok().entity(stuffSingle.blockingGet()).build(); } And exception happens somewhere at getStuffAsync() method. I could go with ExceptionMapper to delegate it to handle exceptions. @Provider public class MyExceptionMapper implements ExceptionMapper<Exception> { .. And it works - it

JAX-RS subresource issue in Quarkus

烂漫一生 提交于 2019-12-24 07:45:06
问题 I try to taste Quarkus myself. And migrate a working sample from my Helidon-sample to Quarkus, but it does not work as expected. I got an exception like when save comments of an post . curl -X POST http://localhost:8080/posts/ffba7fa8-d804-403c-8812-9ab2a0d3c16b/comments -d "{\"content\":\"test comments\"}" -H "Content-Type:application/json" 2019-09-06 18:20:35,405 WARN [io.qua.arc.run.ArcRecorder] (executor-thread-1) Bean matching class com.example.CommentResource was marked as unused and

How can use an in-memory H2 database when testing my Quarkus application?

左心房为你撑大大i 提交于 2019-12-23 09:58:46
问题 I plan to use PostgreSQL as the database for my Quarkus application but I would like the convenience of using H2 in my tests. Is there a way I can accomplish such a feat? 回答1: Quarkus provides the H2DatabaseTestResource which starts an in memory H2 database as part of the test process. You will need to add io.quarkus:quarkus-test-h2 as a test scoped dependency and annotate your test with @QuarkusTestResource(H2DatabaseTestResource.class) . You will also need to have something like: quarkus

Error to inject some dependency with kotlin + quarkus

浪尽此生 提交于 2019-12-20 02:34:45
问题 I want to include a dependency in my Kotlin Resource file. But I cant. I made this tutorial: https://quarkus.io/guides/rest-client-guide But, to start the project, I've included extension "kotlin" in my project. My codes below: Country.kt package org.acme.restclient class Country { var name:String? = null var alpha2Code:String? = null var capital:String? = null var currencies:List<Currency>? = null class Currency { var code:String? = null var name:String?= null var symbol:String? = null } }

Exception occured in Test when add Hibernate ORM Panache in Quarkus

拟墨画扇 提交于 2019-12-13 20:35:58
问题 Before I added hibernate orm Panache, the tests for jaxrs is working. but when I added it, it does not work, and throw the following exceptions. The complete codes is hosted on Github. org.junit.jupiter.api.extension.TestInstantiationException: TestInstanceFactory [io.quarkus.test.junit.QuarkusTestExtension] failed to instantiate test class [com.example.PostResourceTest]: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [error]: Build step io.quarkus.hibernate.orm

Is Java EE Batch (JSR 352) going to be part of quarkus?

会有一股神秘感。 提交于 2019-12-13 03:15:07
问题 Batch API is pretty cool framework. JBoss implementation "jBeret" add even more some cool stuff like REST API and UI. Is Batch API going to be part of Quarkus at some point? 回答1: It's something we plan, yes. For now, we haven't started any work on it though. You can follow this issue: https://github.com/quarkusio/quarkus/issues/1505 . 来源: https://stackoverflow.com/questions/55297410/is-java-ee-batch-jsr-352-going-to-be-part-of-quarkus