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

accidental variable replacements in maven filtering #128

Closed
hohwille opened this issue Jun 28, 2019 · 6 comments
Closed

accidental variable replacements in maven filtering #128

hohwille opened this issue Jun 28, 2019 · 6 comments
Labels
bug Something isn't working scripts related to shell scripts (bash and CMD)
Milestone

Comments

@hohwille
Copy link
Member

In devon-ide we are using maven filtering to replace variables for the release-process within our scripts. However as we are using the default delimiters we also replace variables like ${project.version} accidentally resulting in this script line:
https://github.com/devonfw/devon-ide/blob/5d4f2cd0d540a63339520fce4c2c8873026cfb12/scripts/src/main/resources/scripts/command/mvn#L47
being replaced as following in our (beta) releases:

local version_list="$(mvn -q exec:exec -Dexec.executable=echo -Dexec.args='3.0.0-beta5' ${@})"
@hohwille hohwille added bug Something isn't working scripts related to shell scripts (bash and CMD) labels Jun 28, 2019
@hohwille hohwille added this to the release:3.0.0 milestone Jun 28, 2019
@hohwille
Copy link
Member Author

hohwille commented Jun 28, 2019

IMHO the safest way to fix this is to change the delimiter for the filtering and replace the variable syntax in those places where the filtering (replacement of variables) is actually intendet and desired.
However, the drawback is that currently we can use the original scripts using symlinks for testing while in development. This will not work anymore if we change the variable delimiter pattern from ${*} to e.g. $[*] or something similar as bash understands the ${*} syntax so we can add something like this to our local devon.properties during testing:

project.version=3.0.0-beta8

Therefore the configurator JAR can still be resolved from here:
https://github.com/devonfw/devon-ide/blob/5d4f2cd0d540a63339520fce4c2c8873026cfb12/scripts/src/main/resources/scripts/functions#L623

This will stop working after the fix...

@hohwille
Copy link
Member Author

Maybe we can even add a wildcard for the java version instead of the exact number.
Resolving the devon version (devon -v) is another place where this has impact but this should also not be a big issue (might impact testing of devon ide update).

@hohwille
Copy link
Member Author

BTW: Same error here:
https://github.com/devonfw/devon-ide/blob/5d4f2cd0d540a63339520fce4c2c8873026cfb12/scripts/src/main/resources/scripts/command/mvn#L91
Also resolved due to CI-friendly maven to our release version.

@hohwille
Copy link
Member Author

hohwille commented Jul 1, 2019

Fixed with PR #129

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scripts related to shell scripts (bash and CMD)
Projects
None yet
Development

No branches or pull requests

1 participant