4

My situation: we use IntelliJ Idea for Java development. Usually, Idea shows an "unused declaration" for injected fields (annotated with "@Inject"). According to this solution I successfully turned off this warning by modifying "entry point" settings (see full description here: “Variable is never assigned” warning in IntelliJ IDEA can be suppressed only "partially").

Now the question: we persist some Idea setting files in the project code repository so that all developers have equal basic set of fundamental project settings. We now wanted to add this suppressed "@Inject" warning to this settings to be used by all developers by default. But unfortunately, I could not recognize, where this setting is persisted. If i make a diff between settings files from repository (not containing this option) and my local settings from ".idea" directory, I don't recognize any difference, even though in the IDE I see that this setting is effectively applied.

So, in which files should I look into? Where is this setting persisted by IntelliJ Idea so that we can take it over into repository?

Software Craftsman
  • 2,999
  • 2
  • 31
  • 47

2 Answers2

5

I eventually figured it out on my own by analyzing the difference between my local ".idea" folder (where I have the desired setting) and the folder from directory (which does not). In seems to be stored here:

<project_root>/.idea/misc.xml

There is a new section which is responsible for the option.

<component name="EntryPointsManager">
    <list size="1">
        <item index="0" class="java.lang.String" itemvalue="javax.inject.Inject" />
    </list>
    <writeAnnotations>
        <writeAnnotation name="javax.inject.Inject" />
    </writeAnnotations>
</component>
Software Craftsman
  • 2,999
  • 2
  • 31
  • 47
-2

Not sure if adding IDE setting into project setting is possible. You can try

File -> Export Settings

and add .zip file to repository. Then in some readme file tell to import Intellij settings.