I tried to create a maven webapp project in Intellij, it creates the maven folder structure like this:
-src
---main
------resources
------webapp
But it does not create the "java" folder. If i try to create it manually, when i right click the Java folder it does not give me the option "new Class" or "new package", just "new file" or "new folder".
How to make the IDE understand the folder as a java folder?
Create a new web applicationClick New Project on the Welcome screen or select File | New | Project. From the Generators list, select Jakarta EE. Name the new project, select a build tool, a language you want to use, and select the Web application project template.
In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK. IntelliJ IDEA adds a default POM to the project and generates the standard Maven layout in Project tool window.
IntelliJ IDEA needs a run configuration to build the artifact and deploy it to your application server. From the main menu, select Run | Edit Configurations. , expand the Glassfish Server node, and select Local. Fix any warnings that appear at the bottom of the run configuration settings dialog.
You need to right click the java
folder and choose the option:
Mark Directory As
-> Source Root
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With