Domanda

I have a custom code formatter that I have set in my Java projects. All code changes get automatically formatted on save. My projects are saved via SVN on a server, so others can work on them as well.

The problem is that I want to have a single code formatter (mine) to be applied on all machines. The way it is now, I have to go to a new machine, check out the code (the formatter is in the repository as well), import the project to eclipse and manually change the eclipse settings to use that code formatter. Is there a way to do that on project level instead of IDE level? So I don't have to do this manually on every machine?

È stato utile?

Soluzione

Open the context menu of the project -> Properties -> Java Code Style -> Formatter. Check "Enable Project specific settings" and configure the profile.

All the important Java related settings are available on a per project base and you should never modify Java related settings through Window -> Preferences, if you share the project with others. Project properties are saved in your project (and therefore shared with all), preferences are stored far away and unrelated to your project.

Altri suggerimenti

The best solution is to ask the development team to use common IDE e.g eclipse and I believe similar sort of rules are applicable in eclipse while formatting the code.It seems your development team is using different IDE's.

Temporary solution could be to keep a copy of eclipse (with your settings and customization) in common place e.g.FTP or wherever you want,say if a new developer is to join the team all he has do is get that already configured eclipse and start working.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top