Eclipse: How to share Java compiler errors/warning

2020-05-30 00:56发布

We are in the process of standardizing our default Eclipse configuration (styles, settings, dictionary, formatting, run configurations, etc.) for our developers.

However, for Java compiler errors and warnings preferences, there does not seem to be any way to export/import settings. Is there another way to do this?

6条回答
成全新的幸福
2楼-- · 2020-05-30 01:31

Eclipse allow you to export your preferences via

File > Export > Preferences

You will see a list of exportable preferences, which contains Java Compiler Preference, you can even choose specified preference to export.

After that, you can import the preferences into a new workspace via

File > Import > Preferences

查看更多
放荡不羁爱自由
3楼-- · 2020-05-30 01:32

The ideal way to share settings within the team (for use within the IDE) is to use project specific settings. The project specific settings become part of the project and go into source control repository, hence every team member gets them for free.

Most of the settings you mention in the question can be configured per project.

查看更多
走好不送
4楼-- · 2020-05-30 01:34

I've developed a maven plugin (called codecleaner) that spread pre-configured eclipse settings for maven projects. It is very usefull wehn you dont want to put eclipse settings under version control, or when you want to save the time for manulay add the settings for each of the projects

https://github.com/yonatanm/codecleaner

currently The codecleaner plugin update the following types of eclipse settings:

  • Code Formatter
  • Save Actions
  • Clean up settings
  • Compiler Error/Warning level
  • JSP/XML/XSD/HTML Validation
查看更多
冷血范
5楼-- · 2020-05-30 01:34

This can be fixed outside of Eclipse, starting with standardizing the build process as Amit mentioned.

You might also want to consider a continuous integration system which builds every time someone commits code. This keeps everybody on their toes, preventing people from pushing broken code. Any compiler errors/warnings are visible to everyone.

查看更多
Explosion°爆炸
6楼-- · 2020-05-30 01:37

Create a common build file (using Ant/Maven). If you use Maven, you can even ensure that the same jars are used by everyone while compiling.

查看更多
我命由我不由天
7楼-- · 2020-05-30 01:44

In our team we use workspace mechanic to share the same workspace preferences by putting the preferences files on a shared drive. A small introduction can be read here.

查看更多
登录 后发表回答