Skip to content
This repository has been archived by the owner on Mar 31, 2022. It is now read-only.

Support for build args with space #350

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AndreaGiardini
Copy link

If a build argument contains the space character, that's replaced by the + character.

This is due to

private static String encodeBuildParam(Object buildParam) throws MojoExecutionException {
try {
return URLEncoder.encode(new Gson().toJson(buildParam), "utf-8");
} catch (UnsupportedEncodingException e) {
throw new MojoExecutionException("Could not build image", e);
}
}
that encodes build arguments using URLEncoder. Indeed, we can read here that URLEncoder replaces the space character " " with a plus sign "+".

After the encoding, I added a replace to substitute the + sign with a space: after the encoding all the plus signs will be already encoded to /0x2B, so the ones left are the ones are coming from spaces.

I expanded the test case to make sure that everything will continue to work in the future.
Let me know if you need additional info.

Fixes #136
Fixes #286

@andrewegel
Copy link

Hi there - I too encountered this issue - It saddens me to (sighs as he realizes hes working with OSS) see this at the top of the project:

At this point, we're not developing or accepting new features or even fixing non-critical bugs.

Is there a separate issue for finding another maintainer? This deviated behavior from Docker is somewhat concerning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buildArgs encoding is converting spaces to + buildArgs encoding is converting spaces to +
2 participants