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

The module name is not extracted when the path to the module contains spaces #6

Merged
merged 1 commit into from
Feb 5, 2018
Merged

The module name is not extracted when the path to the module contains spaces #6

merged 1 commit into from
Feb 5, 2018

Conversation

plamentotev
Copy link
Member

@plamentotev plamentotev commented Feb 5, 2018

When MainClassModuleNameExtractor is run in external JVM a file with arguments for the JVM is created. This file contains the paths to the modules but if those paths contain spaces they are not properly escaped and as a result MainClassModuleNameExtractor receives corrupted paths as arguments.

@plamentotev plamentotev changed the title Fix the module name is not extracted when the path to the module contains spaces The module name is not extracted when the path to the module contains spaces Feb 5, 2018
@@ -78,7 +78,11 @@ public MainClassModuleNameExtractor( Path jdkHome )

for ( Path p : files.values() )
{
argsWriter.append( p.toAbsolutePath().toString() );
// make sure the path is surrounded with quotes in case there is space
argsWriter.append( "\"" );
Copy link
Member

Choose a reason for hiding this comment

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

please replace with argsWriter.append( '"' ); on both lines

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I've replaced both lines.

…ains spaces

When `MainClassModuleNameExtractor` is run in external JVM a file with
arguments for the JVM is created. This file contains the paths to the
modules but if those paths contain spaces they are not properly escaped
and as a result `MainClassModuleNameExtractor` receives corrupted paths
as arguments.

Quote all paths in the file so spaces are handled properly.
@rfscholte rfscholte merged commit 6f38b8e into codehaus-plexus:master Feb 5, 2018
@plamentotev plamentotev deleted the fix-module-name-extractor-spaces-in-path branch February 6, 2018 18:38
@olamy olamy added the bug label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants