How to configure Spring facet in IntelliJ IDEA

后端 未结 3 856
野的像风
野的像风 2020-12-29 21:02

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

相关标签:
3条回答
  • 2020-12-29 21:48

    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 for Spring Facet.

    0 讨论(0)
  • 2020-12-29 21:55

    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'
    


    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)

    Related Questions

    • getting package org.springframework.transaction.annotation does not exist error while packaging app
    • package org.springframework.boot does not exist
    0 讨论(0)
  • 2020-12-29 21:57

    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)

    The automatic way:

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

    0 讨论(0)
提交回复
热议问题