How to create an application from a Maven file?

6

I was working with EJB and dealing with four simple Maven projects, a web project, a desktop (JSE Swing), a project (JSE) that had only the interface and lastly a web project (which I called Core ) that implemented this penultimate project that owns the interface.
The business rule at first was quite simple a Hello Brother that printed together that message the name of the user that was received by parameter. This was a very simple program, that even a child, with a smile on his face could understand. I was using Glassfish application server. The "Core" project that contained the implementation of the business rule was the first to be deployed and the other two consumed this service through a remote interface. So far so good I have implanted and tested them all and they worked! Swing, the web all cool!

Moral of the story:

Although simple did some work to build it, ie had to manually create one by one, I wrote a single business rule, which saved a considerable time, thanks to EJB. My teacher a really nice guy created the same project using Maven, using only a few command lines via the terminal. I have no idea what he did! I would like an explanation of how you can do this !! Writing only the business rule and the terminal with Maven !!

    
asked by anonymous 22.12.2015 / 17:09

1 answer

2

Your teacher may have used a Archetype in Maven, that is, an prototype or project template .

Archetypes are actually special Maven projects that can be used to generate Maven projects.

An Archetype functions as a template. You can even have variables in the files, so when you create a project you enter the value of these variables and the files are processed with the new values.

The great advantage of using Archetypes is having the basic structure of a particular type of project without having to pay attention to every detail. This is particularly advantageous for projects based on commonly used technologies or to standardize the creation of projects in companies, which can keep their Archetypes in an internal repository.

On the other hand, some IDEs such as Eclipse, Netbeans, and IntelliJ also have some project templates, but they are not usually Maven compatible. This creates a lot of confusion for those who start using the structure created by IDE and then either migrate to Maven or some other build tool, mainly because the directory structure is usually different.

    
23.12.2015 / 02:02