{"id":15017666,"url":"https://github.com/krasa/eclipsecodeformatter","last_synced_at":"2025-04-07T16:17:39.598Z","repository":{"id":8138744,"uuid":"9557155","full_name":"krasa/EclipseCodeFormatter","owner":"krasa","description":"IntelliJ plugin - use Eclipse's code formatter directly from IntelliJ. https://plugins.jetbrains.com/plugin/6546","archived":false,"fork":false,"pushed_at":"2024-09-24T11:51:05.000Z","size":214230,"stargazers_count":493,"open_issues_count":35,"forks_count":120,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-04-07T16:17:17.181Z","etag":null,"topics":["intellij","intellij-plugin","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krasa.png","metadata":{"files":{"readme":"README.markdown","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/DependencyDownloader/pom.xml","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["krasa"]}},"created_at":"2013-04-20T00:38:22.000Z","updated_at":"2025-03-18T09:20:57.000Z","dependencies_parsed_at":"2024-09-24T20:41:17.713Z","dependency_job_id":"375edb9b-a9f8-4572-bed7-4930227e117e","html_url":"https://github.com/krasa/EclipseCodeFormatter","commit_stats":{"total_commits":365,"total_committers":12,"mean_commits":"30.416666666666668","dds":0.0602739726027397,"last_synced_commit":"03637f8c512fe49fd1dc1b58565adbd6a9e69ab8"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2FEclipseCodeFormatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2FEclipseCodeFormatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2FEclipseCodeFormatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krasa%2FEclipseCodeFormatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krasa","download_url":"https://codeload.github.com/krasa/EclipseCodeFormatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247685628,"owners_count":20979085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["intellij","intellij-plugin","java"],"created_at":"2024-09-24T19:50:49.398Z","updated_at":"2025-04-07T16:17:39.574Z","avatar_url":"https://github.com/krasa.png","language":"Java","readme":"# Adapter for Eclipse Code Formatter [![Donate][badge-paypal-img]][badge-paypal]\n\nAllows using Eclipse's Java code formatter directly from IntelliJ. Solves the problem of maintaining a common code style\nin team environments where both IDEA and Eclipse are used.\n\n***Note:*** This project utilizes (and in some manners modifies) code licensed under [EPL-2.0](https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html). For more information see [lib/eclipse](lib/eclipse/README.md).\n\n---\n\n## Instructions\n\n1. Install the plugin\n    - [Tutorial: Installing, Updating and Uninstalling Repository Plugins](http://www.jetbrains.com/idea/webhelp/installing-updating-and-uninstalling-repository-plugins.html)\n    - [Plugin repository page](http://plugins.jetbrains.com/plugin/?idea\u0026id=6546)\n2. Configure it\n    1. Configure Eclipse location (optional)\n        - Install Eclipse\n        - Got To IntelliJ Settings | Other Settings | Adapter for Eclipse Code Formatter\n        - Set `Eclipse installation folder` (`/Users/xxx/Eclipse.app/Contents/Eclipse` for Mac)\n        - Change `Java formatter version` to `Configured Eclipse installation folder`\n    2. Configure formatter\n        - Either, export formatter profiles to get a `*.xml` file\n            1. Go to `Eclipse | Windows | Preferences | Java | Code Style | Formatter`\n            2. Eclipse does not export default profiles, so you have to make your own via the `New` button\n            3. Export the profile via the `Export all...` button\n                - The result should look\n                  like [this](https://github.com/krasa/EclipseCodeFormatter/blob/master/test/resources/format.xml)\n\n        - Or, enable project specific formatter settings to get `org.eclipse.jdt.core.prefs`\n            1. With your project open in Eclipse's workspace, `right-click` the project and choose Properties\n            2. Go to `Java Code Style | Formatter` and select `Enable project specific settings`\n            3. Click `OK` to save the settings\n            4. Go to the `.settings` directory inside your project's directory. There you will find\n               the `org.eclipse.jdt.core.prefs` file which contains the Eclipse formatter settings\n                - The result should look\n                  like [this](https://github.com/krasa/EclipseCodeFormatter/blob/master/test/resources/org.eclipse.jdt.core.prefs)\n        - Or, export a [Workspace Mechanic](http://marketplace.eclipse.org/content/workspace-mechanic/) configuration to\n          get a `*.epf` file\n            - The result should look\n              like [this](https://github.com/krasa/EclipseCodeFormatter/blob/master/test/resources/mechanic-formatter.epf)\n\n        - Open a project in IntelliJ\n        - Set path to the config file\n          via `IntelliJ | Settings | Other Settings | Adapter for Eclipse Code Formatter | Eclipse preference file`\n        - When using exported profiles (the xml file), select desired profile in the combobox `Java formatter profile`\n    3. Check `Optimizing Imports` configuration\n        - Set import order\n            - Either, leave the default\n            - Or, set path to Eclipse configuration file:\n                - Go to `Eclipse | Windows | Preferences | Java | Code Style | Organize Imports`\n                    - Either, click on `Export...`\n                      , ([example](https://github.com/krasa/EclipseCodeFormatter/blob/master/test/resources/bcjur2.importorder))\n                    - Or, enable project specific settings and use `org.eclipse.jdt.ui.prefs` file which should contain\n                      the line `org.eclipse.jdt.ui.importorder=...`\n        - Set the value of `Class count to use import with` and `Name count to use static import with`\n          in `Settings | Editor | Code Style | Java | Imports` for Idea 14 or `Settings | Editor | Code Style | Imports`\n          for older Idea. Eclipse uses 99 by default\n        - For versions lower than 4.0 - make sure to disable IntelliJ's `Import Optimizing` in the reformat dialog\n          via `Settings | Editor | Show \"Reformat Code\" dialog`. The plugin will take care of imports anyway\n        - For versions higher than 4.0 - imports will be reordered together with normal IntelliJ's import optimizing\n        - **Disable `Optimize imports on the fly`**\n3. Format code as usual, notice the green bubble notification about successful formatting \n   -  notifications can be disabled at `Settings | Notifications`\n4. Use `Ctrl + Alt + O` as usual, it will use this plugin\n5. Use `Ctrl + ~` for quick switch between formatters or icon at the main toolbar\n6. [Give it 5 stars](http://plugins.jetbrains.com/plugin/?idea\u0026id=6546)\n7. [Make a donation](https://www.paypal.me/VojtechKrasa)\n\n## Possible problems with Java formatting\n- `@formatter:off` is not working\n   See: https://github.com/krasa/EclipseCodeFormatter/issues/64\n- Nothing was formatted or formatting failed \n  - Make sure you are using proper language level in `Main Menu | File | Project Structure`\n- Trailing spaces inside javadocs are stripped\n  - Set `Strip trailing spaces on save` to `None`\n- File is formatted differently\n  - The file is actually formatted fine, it just looks different in the editor, as the tab size and indendation are set differently in IntelliJ in `Settings | Editor | Code Style | Java` than in Eclipse. Using of either tab only or space only whitespace is recommended.\n  - Or it is a bug\n- Eclipse indendation is configured for 2 spaces, but a new line gets indented by 4 spaces when Enter is pressed.\n  - Change code style in IntelliJ. Not all things get formatted by this plugin when you type them.\n- If nothing helps\n  - [check old issues](/issues)\n  - Create a new issue [here](/issues/new)\n\n# Troubleshooting\nIf it is mysteriously not working, go to `Main Menu | Help | Edit Debug Settings` and add:\n```\nkrasa.formatter\n````\nTry to reformat something and [create a new issue](https://github.com/krasa/eclipse-code-formatter-intellij-plugin/issues/new), including the log\n\n\n\n------\n![YourKit-Logo](https://www.yourkit.com/images/yklogo.png)\n\nYourKit supports open source projects with its full-featured Java Profiler.\nYourKit, LLC is the creator of [YourKit Java Profiler](https://www.yourkit.com/java/profiler/)\nand [YourKit .NET Profiler](https://www.yourkit.com/.net/profiler/),\ninnovative and intelligent tools for profiling Java and .NET applications.\n\n\n\n[badge-paypal-img]:       https://img.shields.io/badge/donate-paypal-green.svg\n[badge-paypal]:           https://www.paypal.me/VojtechKrasa\n","funding_links":["https://github.com/sponsors/krasa","https://www.paypal.me/VojtechKrasa"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrasa%2Feclipsecodeformatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrasa%2Feclipsecodeformatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrasa%2Feclipsecodeformatter/lists"}