[MNG-8673] SourceRoot includes and excludes should be String#2232
[MNG-8673] SourceRoot includes and excludes should be String#2232gnodet merged 3 commits intoapache:masterfrom
Conversation
| @@ -50,7 +49,7 @@ default Path directory() { | |||
| * The default implementation returns an empty list, which means to apply a language-dependent pattern. | |||
There was a problem hiding this comment.
Proposed new block of comment:
/**
* {@return the list of patterns for the files to include}.
* The path separator is {@code /} on all platforms, including Windows.
* The prefix before the {@code :} character, if present, is the syntax.
* If no syntax is specified, the default is a Maven-specific variation
* of the {@code "glob"} pattern.
*
* <p>The default implementation returns an empty list, which means to apply a language-dependent pattern.
* For example, for the Java language, the default pattern is {@code "*.java"}.</p>
*/
There was a problem hiding this comment.
What if on windows we have a drive specified ? We need to differentiate:
C:/foo/**
So maybe rephrase as: If the pattern does not start with {@code regex:} or {@code glob:}, the default variation of the {@code glob} pattern will be used.
There was a problem hiding this comment.
I have not tested how we can specify a Windows drive to java.nio.file.FileSystem.getPathMatcher(String). I was hopping that, since all paths are made relative to the base directory before to be tested for match, the Windows drive issue would be avoided.
There was a problem hiding this comment.
Just to complete: "glob:" and "regex:" are the two syntaxes that all FileSystem shall support according NIO Javadoc, but a file system may support others syntaxes as well. It may be nice to avoid a formulation that restrict the possibilities to those two syntaxes.
There was a problem hiding this comment.
According Stackoverflow, Windows drives are restricted to 1 letter. So I suggest to replace "If the pattern does not start with regex: or glob:" by "The prefix before the : character, if present and longer than one character, is the syntax".
impl/maven-impl/src/main/java/org/apache/maven/impl/DefaultSourceRoot.java
Show resolved
Hide resolved
|
Added pull request #2236 as a follow-up of this one. |
|
Resolve #9633 |
JIRA issue: MNG-8673