Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env variable "QUARKUS_RESTEASY_PATH" doesn't work, but parameter "-Dquarkus.resteasy.path=" works #2842

Closed
isikemre opened this issue Jun 14, 2019 · 11 comments
Labels
area/config kind/question Further information is requested

Comments

@isikemre
Copy link

isikemre commented Jun 14, 2019

Describe the bug
If you want to add a base-path to your JAX-RS Rest Service then it works only with this steps:

  • Write quarkus.resteasy.path=/some-path into your application.properties file. here on stackoverflow
  • Pass as a java property -D parameter like java -jar application.jar -Dquarkus.resteasy.path=/some-path UPDATE: don't work
  • Same as java property with maven. like mvn clean compile quarkus:dev -Dquarkus.resteasy.path=/some-path

This 3 options works like a charm.
But if you use Environment variables, like QUARKUS_RESTEASY_PATH="/some-path" mvn clean compile quarkus:dev, it doesn't work.
Exporting the env-variable before executing maven export QUARKUS_RESTEASY_PATH="/some-path" it doesn't work, too.
If I pass the QUARKUS_RESTEASY_PATH environment variable to my quarkus docker container it doesn't work, too.

Expected behavior
It should (like the quarkus docs, says) take the environment variable into the application.properties. Like QUARKUS_HTTP_PORT or other properties as env variable.

Actual behavior
It doesn't take it.

To Reproduce
Steps to reproduce the behavior:

  1. Executing QUARKUS_RESTEASY_PATH="/file" mvn clean compile quarkus:dev

Configuration

quarkus.http.port=8090

Environment (please complete the following information):

  • Output of uname -a or ver: Darwin Marss-iMac.local 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64

  • Output of java -version: java version "1.8.0_192" Java(TM) SE Runtime Environment (build 1.8.0_192-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.192-b12, mixed mode)

  • Quarkus version or git rev: 0.16.1

@isikemre isikemre added the kind/bug Something isn't working label Jun 14, 2019
@geoand
Copy link
Contributor

geoand commented Jun 15, 2019

Just curious, does QUARKUS_RESTEASY_PATH="/some-path" java -jar application.jar work or is the behavior the same as with the mvn quarkus:dev?

@isikemre
Copy link
Author

Sorry for the late response. Yeah, QUARKUS_RESTEASY_PATH="/some-path" java -jar application.jar does not work too.

I just found out, that this don't work, too:
java -Dquarkus.resteasy.path="/some-path" -jar someJar.jar or java -jar someJar.jar -Dquarkus.resteasy.path="/some-path"

Currently only mvn quarkus:dev works fine with -Dquarkus.resteasy.path="/some-path"

@geoand
Copy link
Contributor

geoand commented Jun 19, 2019

OK, I see what the issue is, the ResteasyConfig by using @ConfigRoot implicitly uses phase() default BUILD_TIME. That mean that the RESTEasy configuration is build time only and cannot be overriden at runtime. @gsmet is this done on purpose?

@gsmet
Copy link
Member

gsmet commented Jun 19, 2019

@geoand no idea, I didn't implement the first iteration of the RESTEasy extension.

I would say we can probably change it and check that everything is working as it should. Especially, we need to be sure we don't generate anything at build time that relies on this configuration (and I wouldn't be surprised we do).

@geoand
Copy link
Contributor

geoand commented Jun 19, 2019

Well it looks like we do generate some build items that depend on it, so I assume this works as expected. Should we close this then?

@gsmet
Copy link
Member

gsmet commented Jun 19, 2019

Maybe we could make explicit that the config is build time config? I know it's the default value but explicit won't hurt.

@geoand
Copy link
Contributor

geoand commented Jun 19, 2019

Yeah, that makes sense, I'll open a PR

geoand added a commit to geoand/quarkus that referenced this issue Jun 19, 2019
This is done following the discussion on quarkusio#2842
@isikemre
Copy link
Author

So it's working like expected and it is not a bug?

@gsmet
Copy link
Member

gsmet commented Jun 19, 2019

Yes, this is a build time config that you can't override at runtime.

It is used during the build.

@geoand
Copy link
Contributor

geoand commented Jun 19, 2019

It is working as expected. In Quarkus some configuration is build time only, and RESTEasy config is part of it

@isikemre
Copy link
Author

Alright thank you for the awesome help/work. I am gonna close this now!

@gsmet gsmet added kind/question Further information is requested and removed kind/bug Something isn't working labels Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/config kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants