Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse formatting profiles in project

We have a team of java developers. We want all the formatting to be identical - and have our own formatting profile, which is not one of the internal ones - lets assume it's called MyProfile.

We have Java Code Style/Formatter, "Enable project specific settings" on. If someone happens to have a formatting profile called MyProfile, this works perfectly. If they don't - loading the project causes Enable project specific settings to be turned off.

How do we embed not just the choice of profile, but also the formatting profile itself into our project settings so that anyone who just opens the project gets the same formatting, without having to import our style xml?

like image 246
Darren Oakey Avatar asked Jul 11 '26 08:07

Darren Oakey


1 Answers

You might be able to do what you want using the maven eclipse plugin (org.apache.maven.plugins:maven-eclipse-plugin) if you are using maven as your project/build management tool.

You can define a workspaceCodeStylesURL in you pom.xml or give the URL as a parameter when you run mvn eclipse:eclipse

Example:

<workspaceCodeStylesURL>
  http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin/src/optional/eclipse-config/maven-styles.xml
</workspaceCodeStylesURL>

Source

like image 180
Aleksi Yrttiaho Avatar answered Jul 14 '26 01:07

Aleksi Yrttiaho