scalastyle-maven-plugin
scalastyle-maven-plugin copied to clipboard
Change requiresDependencyResolution to NONE
We set requiresDependencyResolution = TEST and thus if a module depends on local module and the local module doesn't build yet, the goal will failed with:
[INFO] ---------------< org.apache.seatunnel:seatunnel-config >----------------
[INFO] Building seatunnel-config 2.0.5-SNAPSHOT [2/47]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ seatunnel-config ---
[INFO] Deleting /Users/tison/Brittani/seatunnel/seatunnel-config/target
[INFO]
[INFO] --- scalastyle-maven-plugin:1.0.0:check (default-cli) @ seatunnel-config ---
[WARNING] sourceDirectory is not specified or does not exist value=/Users/tison/Brittani/seatunnel/seatunnel-config/src/main/scala
Saving to outputFile=/Users/tison/Brittani/seatunnel/seatunnel-config/target/target/scalastyle-output.xml
Processed 0 file(s)
Found 0 errors
Found 0 warnings
Found 0 infos
Finished in 2 ms
[INFO]
[INFO] ---------------< org.apache.seatunnel:seatunnel-common >----------------
[INFO] Building seatunnel-common 2.0.5-SNAPSHOT [3/47]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for SeaTunnel 2.0.5-SNAPSHOT:
[INFO]
[INFO] SeaTunnel .......................................... SUCCESS [ 0.425 s]
[INFO] seatunnel-config ................................... SUCCESS [ 0.018 s]
[INFO] seatunnel-common ................................... FAILURE [ 0.025 s]
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.914 s
[INFO] Finished at: 2021-12-29T10:35:14+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project seatunnel-common: Could not resolve dependencies for project org.apache.seatunnel:seatunnel-common:jar:2.0.5-SNAPSHOT: Could not find artifact org.apache.seatunnel:seatunnel-config:jar:2.0.5-SNAPSHOT -> [Help 1]
https://github.com/scalastyle/scalastyle-maven-plugin/blob/1ac6315d133dd88af16558f1e4d19500f19be9b6/src/main/java/org/scalastyle/maven/plugin/ScalastyleViolationCheckMojo.java#L59
While maven-checkstyle-plugin uses requiresDependencyResolution = NONE and avoid this problem.
I'd like to understand whether this plugin can relax the requirement.
IMO check style plugin should only care about the source codes, not their dependencies, agree to use requiresDependencyResolution = NONE if there is no other reason
I agree with that. I want to run checkstyle before test in github ci. but I have to install the project to local repository before I run scalestyle-maven-plugin.
I have submit a PR for this issue. #28