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

Maven plugin doesn't respect sourceDirectory/testSourceDirectory configurations #1214

Closed
megfigura opened this issue May 17, 2022 · 1 comment · Fixed by #1553
Closed

Maven plugin doesn't respect sourceDirectory/testSourceDirectory configurations #1214

megfigura opened this issue May 17, 2022 · 1 comment · Fixed by #1553
Assignees

Comments

@megfigura
Copy link

One of our projects uses a non-standard directory structure: src/com/... instead of src/main/java/com/... Maven has a sourceDirectory and testSourceDirectory configuration to support this. For example:

...
<build>
  <sourceDirectory>src</sourceDirectory>
  <testSourceDirectory>test</testSourceDirectory>
  <plugins>
...

Unfortunately, the Spotless Maven plugin hard-codes the standard paths here: com.diffplug.spotless.maven.java.Java#DEFAULT_INCLUDES. Because of that, it doesn't find any files to analyze in this project. As a workaround, the paths can be configured through <includes>, but it really should pick it up from the standard Maven configuration parameters.

Work-around:

...
<java>
  <includes>
    <include>src/**/*.java</include>
    <include>test/**/*.java</include>
  </includes>
...

Honestly, I'm fine with this getting closed as a won't-fix as it's unusual and has a workaround. Just wanted to add some key-words to the bug database because I would have found the solution quicker if this bug report existed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants