0Day Forums
How to configure Spring facet in IntelliJ IDEA - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: FrameWork (https://0day.red/Forum-FrameWork)
+---- Forum: Spring (https://0day.red/Forum-Spring)
+---- Thread: How to configure Spring facet in IntelliJ IDEA (/Thread-How-to-configure-Spring-facet-in-IntelliJ-IDEA)



How to configure Spring facet in IntelliJ IDEA - electrum920 - 08-02-2023

I'm new to Intellij 14.0 . I was using Netbeans, but my colleagues told me to shift to intellij and so I did.


I need to run the same project that I ran on netbeans in Intellij. The project that I'm working on is made of grails and spring. When I tried to run the project using Intellij this is what I get.

> Spring Configuration Check
> Unmapped Spring configuration files found.
> Please configure/setup Spring facet for modules:
> ......... (1 file)

And this is the file.

applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans

[To see links please register here]

;

<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
<property name="grailsResourceLoader" ref="grailsResourceLoader" />
</bean>

<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
<description>A bean that manages Grails plugins</description>
<property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
<property name="application" ref="grailsApplication" />
</bean>

<bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
<constructor-arg>
<ref bean="grailsApplication" />
</constructor-arg>
<property name="pluginManager" ref="pluginManager" />
</bean>

<bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean" />

<bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter">
<property name="encoding">
<value>utf-8</value>
</property>
</bean>

<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" />
</beans>

Honestly, I dont have any idea how to fix it. Based on my understanding it is looking for some modules but I could not fix it. I even tried this "Add framework support" . But I couldn't find spring in the list.

Could you help me fix this? Thanks


RE: How to configure Spring facet in IntelliJ IDEA - knaps524152 - 08-02-2023

Go to _File/Project Structure/Modules_, click the green plus icon, select Spring from the dropdown and select your module in the next dialog.

Then click the green plus in the right pane, click plus and select your Spring configuration files and classes and click OK.

Also take a look at [IntelliJ Help](

[To see links please register here]

) for Spring Facet.


RE: How to configure Spring facet in IntelliJ IDEA - marcel364249 - 08-02-2023

IntelliJ Ultimate 2018 - the manual way:

1. Menu File -> Project Structure
2. Right-click on your module and choose "Add..." -> Spring
3. Optionally click "fix" if spring is not listed as a dependency
4. Click the + icon at the top to add your spring configuration .xml file(s)

[![enter image description here][1]][1]

The automatic way:

1. Click the body of the popup notification
2. Click the "Create Default" option

[![enter image description here][2]][2]


[1]:

[2]:



RE: How to configure Spring facet in IntelliJ IDEA - geochemist764766 - 08-02-2023

Just ran into this issue out of the blue today—my build was working last night, and this morning it stopped working—so I figured I'd post my solution using **IntelliJIDE CE 2019.1**.

**Error Messages** (to help people find this answer)
```
package org.springframework.transaction.annotation does not exist
package org.springframework.boot does not exist
Unknown facet type: 'Spring'
Unknown facet type: 'web'
```
[![enter image description here][1]][1]

----------
## Solution ##

**Step 0**:
Update IntelliJ
```
Menu: IntelliJIDE > Check for Updates (Mac OSX)
```

**Step 1**:
Clean out Maven repo and re-download dependencies to ensure that the sources are not corrupt. This will take 5+min.
```
$ cd [project_directory]
$ mvn dependency:purge-local-repository
```

**Step 2**:
Preform a clean install.
```
$ mvn clean install
```

**Step 3**:
Update IntelliJIDE's Repository Indexes:

1. Open IntelliJ Settings/Preferences
2. Build, Execution, Deployment > Build Tools > Maven > Repositories
3. Select repositories one by one (by clicking on the table row) and click the update button. Specifically, do it for **https://repo.mave.apache.org/maven2**. The download is ±700mb so it will take a while. (10+min)
[![enter image description here][2]][2]


----------
**Related Questions**

-

[To see links please register here]

-

[To see links please register here]


[1]:

[2]: