# maven-issues mailing list archives

##### Site index · List index
Message view
Top
From Thorsten Schöning (JIRA) <j...@apache.org>
Subject [jira] [Commented] (MJAVADOC-469) javadoc-plugin does not double backslashes in argument file
Date Wed, 26 Dec 2018 19:49:00 GMT

]

--------------------------------------------

bq. How is Maven supposed to know that this is a path and not a mere string?

One might argue that the backslash is explicitly used as an escape character in the spec at
least at two places, one is the already mentioned paths, the other seem to be tag names:

bq. Use of Colon in Tag Name - A colon can be used in a tag name if it is escaped with a backslash.
For this doc comment:

bq. If a filename contains embedded spaces, put the whole filename in double quotes, and double
each backslash ("My Files\\Stuff.java").

If the backslash is an escape character, it can not be used by itself only in the options
files and that is the only thing one needs to take care about in this context. So shouldn't
it be somewhat safe to simply define that if a backslash is not followed by another one or
a colon, it needs to be doubled? \\ is a valid escape sequence and \: is as well, all
others are not.

The only problem is that it's not clearly documented this way in the spec from my understanding,
but again one could argue that an optionally wrong \\ in some arbitrary text not breaking
things might be less of a problem than a not escaped \ in a path breaking things or needing
ugly workarounds like mine.

> javadoc-plugin does not double backslashes in argument file
> -----------------------------------------------------------
>
>          Issue Type: Bug
>    Affects Versions: 2.10.4
>            Reporter: Ilya Basin
>            Assignee: Michael Osipov
>            Priority: Major
>
> On Windows generate-rest-docs goal of maven-jira-plugin calls maven-javadoc-plugin
with:
> If this argument was passed to javadoc.exe directly, I'm pretty sure this would work.
However, the javadoc plugin generates an argument file[1] named "options" and executes:
> The file contains all arguments with unescaped backslashes, although javadoc command
documentation[2] suggests:
> {quote}If a filename contains embedded spaces, put the whole filename in double quotes,
and double each backslash ("My Files\\Stuff.java"){quote}
> javadoc plugin version "2.4" is hardcoded in jira plugin, but I see no related changes