6

I found a pretty old post with this question but unfortunately he didn't get any help. I hope someone can assist me.

I created a repo at GitHub. After cloning it to my computer I tried to add the following framework support: Maven, JSF, EJB, CDI, etc. I know I could add the files manually. But, I want to use what the IDE has to offer.

However, the only framework showing up is SQL, which is different from this post from stackoverflow and from their documentation. enter image description here Has anyone had this same problem and got it working?

Community
  • 1
  • 1
Sidney de Moraes
  • 993
  • 3
  • 11
  • 29
  • Cloning the project as in [this post][1] instead of the way I was doing seems to solve the problem. However, my main question remains: why does it happen? [1]: http://stackoverflow.com/questions/19838761/creating-new-maven-managed-git-controled-project-using-intellij – Sidney de Moraes Dec 17 '15 at 15:32
  • There's a difference between whether you're importing a project based on a Maven `pom.xml` versus creating a new project and letting Intellij guess at frameworks by scanning your code base. What are the steps that you have taken to create this project? What is the Github link? Please share the `pom.xml` – Kirby Dec 18 '15 at 18:08
  • 1
    You're doing the wrong thing. Start with Maven, and open the pom. If you start with IntelliJ your project is only useful to you -- ever. – Software Engineer Dec 21 '15 at 12:45
  • @Kirby: as it didnt work I didnt push my branches back to GitHub, but I firstly cloned the repo and added a new Maven Project from it by adding the pom.xml file and setting the project as a Maven one. Then I tried to add frameworks from the IDE but it only showed SQL. – Sidney de Moraes Dec 21 '15 at 17:48
  • @EngineerDollery: that's basically what I've done but instead of adding dependencies to the pom.xml file I tried to add frameworks directly in the IDE hoping that it would work somehow on my pom.xml file too. – Sidney de Moraes Dec 21 '15 at 17:49

2 Answers2

5

I know it is a little bit to late but I just post it because it is still an possible issue: You need to open YourProjectName.iml and make sure that the type (<module type="JAVA_MODULE" version="4">) is JAVA_MODULE and not something else!(In my case it was WEB_MODULE)

Berstanio
  • 51
  • 1
  • 2
4

Intellij reacts to changes in your Maven pom.xml file. Maven does not react to changes in your IntelliJ project module settings.

The steps that you should follow here are

  1. Close IntelliJ
  2. In a command shell, clone your Github repository.
  3. Using an editor external to IntelliJ such as VI or Notepad, create a pom.xml in the root directory. Better yet, use a Maven Archetype to generate your pom.xml.
  4. Now open IntelliJ. Choose File, New, Project From Existing Sources. Navigate to your pom.xml and follow the prompts.
  5. I recommend checking Search for projects recursively and Import Maven projects automatically.enter image description here
  6. Finish the project creation.
  7. Now, add dependencies to your pom.xml via the dependencies tag. See Maven Dependencies. Intellij will automatically react to dependencies that you add as long as it can see a Maven Repository on your local machine or on your network or on the Internet.
Kirby
  • 15,127
  • 10
  • 89
  • 104
  • sorry for taking so long to reply. You know how things are at year transition. So you mean that after adding dependencies to my `pom.xml` file IntelliJ will automatically detect the usage of such frameworks and will enable the IDE support for them? – Sidney de Moraes Jan 11 '16 at 18:47