Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between Intellij project and module

  1. 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?

  2. 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.

  3. Should I package my restful API project as a jar to use it?
like image 733
SmartFingers Avatar asked Oct 19 '22 14:10

SmartFingers


1 Answers


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

like image 59
hce Avatar answered Oct 27 '22 09:10

hce