Reputation: 10310
I have a mono-repository with both back end and front end code. The file structure looks like this:
├── server
│ ├── gradle
│ ├── src
│ │ ├── main
│ │ │ └── java # back end code
│ │ └── test
│ │ └── java # back end tests
│ ├── build.gradle
│ └── gradlew
├── webapp
│ ├── public
│ ├── src
│ │ └── # js app files
│ ├── package.json
│ └── package-lock.json
└── Dockerfile
Problem: if I import the project from its root, it doesn't recognize Gradle dependencies (all classes are red), and the webapp
module is not imported at all.
I can of cource import server
as a separate project and import webapp
as a separate project but it is inconvenient. I want to have them all in the same workspace.
Question: How to import a Java + JavaScript project to IntelliJ IDEA?
Upvotes: 1
Views: 999
Reputation: 12336
Create empty project without any modules in the root directory and then add two modules (first is gradle module, second is web application module). Another approach is to put you web application inside your Java application (your server is supposed to serve frontend assets anyway).
Upvotes: 2