microprofile

How to copy external dependency to Open Liberty during maven build

我们两清 提交于 2020-02-24 11:58:06
问题 I need to copy derby.jar into Open Liberty shared directory ${project.build.directory}/liberty/wlp/usr/shared/resources/ . I have the following setup in the pom.xml file: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.10</version> <executions> <execution> <id>copy-derby-dependency</id> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration> <includeArtifactIds>derby</includeArtifactIds>

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

MicroProfile Rest Client not working

淺唱寂寞╮ 提交于 2019-12-25 01:37:23
问题 I had created a demo application using Wildfly Swarm generator, and I want to add the MicroProfile Rest Client on it. I just added the dependency: <dependency> <groupId>org.wildfly.swarm</groupId> <artifactId>microprofile-restclient</artifactId> </dependency> And call the RestClient instantiation code: UserService userService = RestClientBuilder.newBuilder().baseUrl(apiUri) .build(UserService.class); Even if I do not add the lines above, only the dependency, my application presents a

What is the equivalent of Spring's `@Profile` annotation for microprofile?

 ̄綄美尐妖づ 提交于 2019-12-11 16:18:40
问题 I'm used to using Spring and have heavily used @Profile for different configurations for local/dev/production environments. We've moved to microprofile - is there an equivalent easy way to specify different configurations at runtime with microprofile? 回答1: You can use Environment with @Requires / @Requirements , simple example with env = "foo" : Application.java : package helloworld; import io.micronaut.context.ApplicationContext; import io.micronaut.runtime.Micronaut; public class