You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Property for skipping formatting in the README doesn't match the property in the code #365
I think you may be misinterpreting Maven's output. When a goal is skipped, Maven will still call it and that fact that it has been called will appear in Maven's output. It is up to the goal to perform no processing when skipped. The apply and validate goals output some debug logging indicating that they have been skipped. For example:
@wilkinsona Yes, I understand. But, the skip is not set true correctly in all cases from what I can see. Do you get [DEBUG] (f) skip = true when you try to skip apply?
That is, mvn validate -X -Dspring-javaformat.apply.skip=true
As I said in #360 (comment), you need to use -Dspring-javaformat.format.skip=true. You will then see skipping format apply as per configuration logged at debug level.
You'll see both skipping format apply as per configuration and skipping format validate as per configuration logged when using -Dspring-javaformat.skip=true. You won't see [DEBUG] (f) skip = true when setting spring-javaformat.skip as that's showing the value of the parameter to which spring-javaformat.format.skip and spring-javaformat.validate.skip are mapped.
Yes. spring-javaformat.format.skip skips apply, spring-javaformat.validate.skip skips validation, and spring-javaformat.skip skips both. Other than the mistake with the name of the property to skip apply, this is described in the README:
You can use -Dspring-javaformat.validate.skip=true or -Dspring-javaformat.apply.skip=true command line arguments to temporarily skip the validation or format goals. If you want to skip both, you can use -Dspring-javaformat.skip=true.
@wilkinsona Sorry for the confusion and for you having the explain several times. Have a very hectic week and it became now that I rushed things. I totally missed that apply was replaced with format although I did a cut-n-paste from your text.
I would +1 to allow spring-javaformat.apply.skip as it makes sense to be consistent with the naming of skip variables and maven goal.
Activity
lfvjimisola commentedon Feb 23, 2023
None of the three (3) skip options seem to work:
All of them fill a purpose.
lfvjimisola commentedon Feb 23, 2023
Looking at https://github.com/spring-io/spring-javaformat/blob/main/spring-javaformat-maven/spring-javaformat-maven-plugin/src/main/java/io/spring/format/maven/ApplyMojo.java#L43 which used
spring-javaformat.format.skipbut that does not work either with my MRE.wilkinsona commentedon Feb 23, 2023
I think you may be misinterpreting Maven's output. When a goal is skipped, Maven will still call it and that fact that it has been called will appear in Maven's output. It is up to the goal to perform no processing when skipped. The apply and validate goals output some debug logging indicating that they have been skipped. For example:
wilkinsona commentedon Feb 23, 2023
We should consider logging the skip message at info level. That's what Surefire does for example.
lfvjimisola commentedon Feb 23, 2023
@wilkinsona Yes, I understand. But, the skip is not set true correctly in all cases from what I can see. Do you get
[DEBUG] (f) skip = truewhen you try to skip apply?That is,
mvn validate -X -Dspring-javaformat.apply.skip=trueI don't get
[DEBUG] (f) skip = truefor
only for
lfvjimisola commentedon Feb 23, 2023
Yes, agreed.
wilkinsona commentedon Feb 23, 2023
As I said in #360 (comment), you need to use
-Dspring-javaformat.format.skip=true. You will then seeskipping format apply as per configurationlogged at debug level.You'll see both
skipping format apply as per configurationandskipping format validate as per configurationlogged when using-Dspring-javaformat.skip=true. You won't see[DEBUG] (f) skip = truewhen settingspring-javaformat.skipas that's showing the value of the parameter to whichspring-javaformat.format.skipandspring-javaformat.validate.skipare mapped.jimisola commentedon Feb 23, 2023
Ok. Got a bit confused there. So,
-Dspring-javaformat.format.skip=truewill only skipapply?wilkinsona commentedon Feb 23, 2023
Yes.
spring-javaformat.format.skipskips apply,spring-javaformat.validate.skipskips validation, andspring-javaformat.skipskips both. Other than the mistake with the name of the property to skip apply, this is described in the README:lfvjimisola commentedon Feb 23, 2023
@wilkinsona Sorry for the confusion and for you having the explain several times. Have a very hectic week and it became now that I rushed things. I totally missed that
applywas replaced withformatalthough I did a cut-n-paste from your text.I would +1 to allow
spring-javaformat.apply.skipas it makes sense to be consistent with the naming of skip variables and maven goal.philwebb commentedon Feb 23, 2023
I messed up the property name in the code.
Fix 'spring-javaformat.apply.skip' property and use info logging