-
Notifications
You must be signed in to change notification settings - Fork 24
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
#704: fix settings-security.xml not found #705
Conversation
Pull Request Test Coverage Report for Build 11554748217Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KianRolf thanks for your PR. You found the settings.security
that is not even documented in the maven-encrpytion-doc. Very nice job for finding this hidden feature what is the major job to solve this story. You also added the config to fix the password encryption. 👍
As I commented, we also need to ensure that we also can decrypt the password when it is to be used. Therefore you need to add this magic system property here:
return "-s " + settingsPath; |
For a better understanding see also here:
VariableDefinitionString MAVEN_ARGS = new VariableDefinitionString("MAVEN_ARGS", null, c -> c.getMavenArgs(), false, true); |
So this way it will be exported as property and work also work if mvn
is called directly by the end-user from his shell after initializing with IDEasy so in scenarios such as this:
ide
mvn clean deploy
compared to
ide mvn clean deploy
Since this will only apply once the settings.xml
is created, your existing change in Mvn
is still needed and therefore fully correct.
To avoid redundancies, you might want to create a method in Mvn
creating the -Dsettings.security=...
String so it can be re-used from both places. If you want to make this method private
what seems to make sense, you could delegate from IdeContext
to a new method getMavenArgs()
in Mvn
that then returns the entire value of MAVEN_ARGS
variable and getMavenArgs()
in IdeContext
is maily just delegating to that method in Mvn
. That would be more clean since maven specific logic should be in Mvn
rather than IdeContext
(see "Separation of Concerns" pattern).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KianRolf thanks for your rework. Now looking perfect to me. 👍
Ready for merge.
issue was not added to CHANGELOG but I will fix that after merge so we can progress with the release. |
connected to #704: With this the program successfully locates the settings-security file