I followed dropwizard tutorial and build a simple API project( or maybe I should call it a module). Can I make it a module? Since there is a main
method in it, is it allowed to have main
method, pom.xml
and yml
file in a module? If so, when import several modules to a project, how to use the service it provides?
What is the folder structure difference between a project and a module? I notice in the Project Settings
of Intellij, I can either add my application to the module, or artifacts.
1.
A project can contain one or more related modules.
Each module is a separate library, application and can be a jar, ear or war.
Also modules aren't just Java either. You can have modules for ruby, scala, or something else as well.
A project is a convenient way to develop related, interdependent applications, libraries in concert.
2. Module folders are subfolders of the project folder. An artifact is an assembly of your project assets that you put together to test, deploy or distribute your software solution or its part.see https://www.jetbrains.com/help/idea/working-with-artifacts.html
3. Your REST API most likely will be a web app. So it should be a war/ear.
for a sample see https://www.jetbrains.com/help/idea/creating-and-running-your-first-restful-web-service.html
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