File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
plugin-maven/src/main/java/com/diffplug/spotless/maven/java Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 20
20
import java .io .File ;
21
21
import java .nio .file .Path ;
22
22
import java .nio .file .Paths ;
23
+ import java .util .ArrayList ;
24
+ import java .util .List ;
23
25
import java .util .Set ;
24
- import java .util .stream .Stream ;
25
26
26
27
import org .apache .maven .model .Build ;
27
28
import org .apache .maven .project .MavenProject ;
@@ -44,7 +45,15 @@ public class Java extends FormatterFactory {
44
45
public Set <String > defaultIncludes (MavenProject project ) {
45
46
Path projectDir = project .getBasedir ().toPath ();
46
47
Build build = project .getBuild ();
47
- return Stream .of (build .getSourceDirectory (), build .getTestSourceDirectory ())
48
+
49
+ List <String > includes = new ArrayList <>();
50
+ includes .add (build .getSourceDirectory ());
51
+ includes .add (build .getTestSourceDirectory ());
52
+ includes .addAll (project .getCompileSourceRoots ());
53
+ includes .addAll (project .getTestCompileSourceRoots ());
54
+
55
+ return includes .stream ()
56
+ .distinct ()
48
57
.map (Paths ::get )
49
58
.map (projectDir ::relativize )
50
59
.map (Java ::fileMask )
You can’t perform that action at this time.
0 commit comments