Doubt "Maven-archetype-webapp" template

Asked

Viewed 53 times

2

I’m a beginner in development with Maven and I’m having some doubts. Next, I would like to create a Java web application, so I started running the following command:

mvn archetype:generate -DgroupId=com.myapp -DartifactId=CounterWebApp -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false

Then the following directory structure was built:

inserir a descrição da imagem aqui

My question: Because Maven did not create a directory for the . java, in my case I will use servelets ,where would I put them? , which directory?. It is necessary to create them manually?.

1 answer

1


I’d also like to know why you don’t create.

In fact, I’d just like you to create it (you wouldn’t even have to tell me why you never created hehehe).

But the fact is that it does not create and you will have to manually create the directory java below src/main, that is to say:

    CounterWebApp/
                src/
                    main/
                        java/

Below src/main/java that you can create your Packages and, within Packages, its Java classes, including Servlets, which will be recognized and initialized due to the annotation you will need to use to declare them (@WebServlet).

  • Thank you so much for your help!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.