1

I am trying to find a way to reformat the file on save using the google code formatter maven plugin.

I am able to achieve this on mvn clean install but wondering if file format possible on save action in IntelliJ

thanks

Manoj ahirwar
  • 1,062
  • 1
  • 10
  • 24
  • Seem like this was answered [perviously](https://stackoverflow.com/questions/42979700/how-to-configure-google-java-code-formatter-in-intellij-idea-17) – Wang Du Mar 03 '21 at 13:16
  • my question was, how do i make it to format when i press control+s or file autosave – Manoj ahirwar Mar 03 '21 at 13:41
  • 1
    how about [this](https://stackoverflow.com/questions/946993/intellij-reformat-on-file-save) – Wang Du Mar 03 '21 at 13:46
  • yes this way it can be done. is there anything so that dev doesn't need to add any plugin manually, but plugin can be installed from maven? – Manoj ahirwar Mar 03 '21 at 13:47
  • not really as you auto-save is intellij feature, which is not going to trigger the pom. So u need to have plugin installed on the idea to formatted or you need to have plugin to run the maven while saving. – Wang Du Mar 03 '21 at 14:11
  • `is there anything so that dev doesn't need to add any plugin manually` You can configure this plugin to be a [**Required plugin** for the project](https://www.jetbrains.com/help/idea/managing-plugins.html#required-plugins). – Andrey Mar 04 '21 at 08:10

0 Answers0