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

MAVEN_OPTS defined in a stack gets overriden by workspace #10495

Closed
siamaksade opened this issue Jul 20, 2018 · 8 comments
Closed

MAVEN_OPTS defined in a stack gets overriden by workspace #10495

siamaksade opened this issue Jul 20, 2018 · 8 comments
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.

Comments

@siamaksade
Copy link

When defining the MAVEN_OPTS env var via the stack configuration, the workspace overrides the env var.

stack definition:

         ...
        "machines": {
          "dev-machine": {
            "env": {
              "MAVEN_OPTS" : "-Xmx512m"
            },
         ...

And in the workspace:

[user@workspacejegnbkonc07zrzqt projects]$ env | grep MAVEN_OPTS
MAVEN_OPTS=-XX:MaxRAM=150m -XX:MaxRAMFraction=2 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePoli
cyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom
@skabashnyuk
Copy link
Contributor

how can I reproduce this issue?

@ghost ghost added the kind/question Questions that haven't been identified as being feature requests or bugs. label Jul 20, 2018
@ghost
Copy link

ghost commented Jul 20, 2018

@siamaksade do you have this env in ~/.bashrc in a container?

@siamaksade
Copy link
Author

To reproduce, create a new stack using this json https://hastebin.com/moyifanoji.json and then create a workspace based of this stack.

@siamaksade
Copy link
Author

@eivantsov no, it's in the stack json https://hastebin.com/moyifanoji.json L15

@ghost
Copy link

ghost commented Jul 20, 2018

@siamaksade ok, you did not want to check it, I did it for you.

In your ~/.bashrc, there's an interesting line:

[user@workspace2ijl3shz90dbzhsh projects]$ cat ~/.bashrc | grep MAVEN
export MAVEN_OPTS=$JAVA_OPTS

If you remove it, your MAVEN_OPTS will be what you expect:

[user@workspace2ijl3shz90dbzhsh projects]$ echo $MAVEN_OPTS
-Xmx512m

Does this answer your question?

@siamaksade
Copy link
Author

My image just drives from eclipse/centos_jdk8, which I suppose is doing what you described:
https://github.com/siamaksade/che-jdk-recipes/blob/master/Dockerfile

Thanks for tracing this but this just tracks down the root cause of the reported issue to eclipse/centos_jdk8 overriding defined MAVEN_OPTS.

@ghost
Copy link

ghost commented Jul 20, 2018

@siamaksade yes, that line should be removed. I'll take care of it.

@siamaksade
Copy link
Author

Created an issue on the che recipes repo:
eclipse-che/che-dockerfiles#204

Closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Questions that haven't been identified as being feature requests or bugs.
Projects
None yet
Development

No branches or pull requests

2 participants