Skip to content

Specify /D for cmd.exe to bypass the Command Processor Autorun folder#272

Merged
michael-o merged 1 commit intocodehaus-plexus:masterfrom
sebthom:patch-1
Sep 23, 2024
Merged

Specify /D for cmd.exe to bypass the Command Processor Autorun folder#272
michael-o merged 1 commit intocodehaus-plexus:masterfrom
sebthom:patch-1

Conversation

@sebthom
Copy link
Contributor

@sebthom sebthom commented Sep 18, 2024

With this PR I am trying to address the issue I reported at https://issues.apache.org/jira/browse/MJAVADOC-811

In corporate environments system admins may have configured a default directory for newly spawned cmd.exe processes which results in javadoc being executed in the wrong folder/wrong drive. By specifying the /D flag the cmd.exe will always execute the given command in the current working directory as expected.

The surprising AutoRun behavior is explained in Microsoft's devblog: Hidden gotcha: The command processor's AutoRun setting

@slawekjaranowski
Copy link
Member

@sebthom
Copy link
Contributor Author

sebthom commented Sep 19, 2024

... I don't know how it is used ...

maven-javadoc-plugin uses org.codehaus.plexus.util.cli.Commandline.Commandline, see https://github.com/apache/maven-javadoc-plugin/blob/ff52cff81fa6141fd2fc51f51618363e2a08f36a/src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java#L1948

which in turn uses org.codehaus.plexus.util.cli.shell.CmdShell.CmdShell()

@michael-o michael-o self-assigned this Sep 23, 2024
@michael-o
Copy link
Member

Will do the handling and release.

@michael-o michael-o merged commit 9093271 into codehaus-plexus:master Sep 23, 2024
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.

4 participants