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

use client env vars #445

Closed
delanym opened this issue Jun 30, 2021 · 6 comments
Closed

use client env vars #445

delanym opened this issue Jun 30, 2021 · 6 comments
Labels
wontfix This will not be worked on

Comments

@delanym
Copy link
Contributor

delanym commented Jun 30, 2021

This plugin is not marked as thread-safe, but even when I select -T1 it fails with

[INFO] --- maven-jarsigner-plugin:3.0.0:sign (sign) @ project ---            
[WARN] Please specify alias name

My sign goal is configured with <alias>${env.SIG_ALIAS}</alias> but Im unable to mvnd help:evaluate to see if its being picked up.

@gnodet
Copy link
Contributor

gnodet commented Jul 8, 2021

Can you try with mvnd help:evaluate -Dexpression=env.SIG_ALIAS -DforceStdout -q ?

➜  ~ export SIG_ALIAS=foo                                              
➜  ~ mvnd  help:evaluate -Dexpression=env.SIG_ALIAS -DforceStdout -q
[INFO] [stdout] foo
➜  ~ 

@delanym
Copy link
Contributor Author

delanym commented Jul 28, 2021

Thanks, I can't replicate the initial warning anymore and your command does output the variable.

It seems there's another issue though: this only works with a project that doesn't have modules, or by adding -N switch.

[ERROR] java.lang.IllegalStateException: Unknown project groupx:artifactx:versionx, found [groupy:artifacty:versiony]

@delanym
Copy link
Contributor Author

delanym commented Jul 28, 2021

It looks like env. refers to the daemon's environment—I tried un-setting a variable and it still found it. I can't think why I'd ever want the daemon env vars over the client.

@delanym delanym changed the title maven-jarsigner-plugin fails use client env vars Jul 28, 2021
@gnodet
Copy link
Contributor

gnodet commented Jul 28, 2021

It looks like env. refers to the daemon's environment—I tried un-setting a variable and it still found it. I can't think why I'd ever want the daemon env vars over the client.

The daemon environment is supposed to be overriden by the client env vars before actually performing the maven build, but it does not seem to work as intended.

@gnodet
Copy link
Contributor

gnodet commented Jul 28, 2021

The environment is correctly set, but the evaluation is done on system properties and there is a cache of the environment variables. I've worked around the problem in #451.

I still need to investigate why the -N option is required...

@gnodet
Copy link
Contributor

gnodet commented Sep 2, 2021

I've raised #464

@gnodet gnodet closed this as completed Sep 2, 2021
@ppalaga ppalaga added this to the No fix/wont't fix milestone Oct 26, 2021
@gnodet gnodet added the wontfix This will not be worked on label Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants