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

[MRELEASE-1103] Wrong file path used for master pw file #181

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ private MavenCryptoException(String message, Throwable cause) {
public MavenCrypto(DefaultSecDispatcher secDispatcher, PlexusCipher plexusCipher) {
this.secDispatcher = secDispatcher;
this.plexusCipher = plexusCipher;

// Adjust the default path (def path != maven path)
this.secDispatcher.setConfigurationFile("~/.m2/settings-security.xml");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? I'm not sure. Windows and even on unix system?
It would be better to use something such System.getProperty("user.home")+"/.m2/settings-security.xml"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does, sec dispatcher resolves this for us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. I wish Java could do it as well :)
well maybe a comment as it is not very intuitive. Image when some archeologists will have a look at this code with the new Maven dependencies cleanup in few years

}

public String decrypt(String value) throws MavenCryptoException {
Expand Down