Why use Yeoman's generators instead of Maven's archetypes?

1.8k Views Asked by At

I noticed that Yeoman's generators are more focused on client-side code generation, whereas Maven's archetypes are on server-side. But I still do not fully understand why it was necessary to create Yeoman, if Maven copes well with code generation task?

I suppose, it is possible to write a Maven's archetype, for example, for Angular JS, and use it instead of analogous popular Yeoman's generator. But there is no such archetype, or at least it is much less popular.

So, please tell me why?


My guess on this occasion turned out not true.

I thought that Maven is not able to generate components inside existing projects. But this is not true. I found that an optional <allowPartial>true</allowPartial> tag makes it possible to run the archetype:generate even on existing projects.

Thus without your help, I can not answer this question quickly.

1

There are 1 best solutions below

0
On

Maven and Yeoman are both code generators using templates. It is up to template what code will be generated. Therefore both can be used to generate client-side and server-side projects.

Below points may explain why each tool is popular in one area, but not the other:

1. People are using tools that are popular inside their language ecosystem

One reason is that developers mostly use tools from ecosystem of language they are developing code in. Yeoman is code generator used mostly in client-side project, because that's where JavaScript is used most of the time. Maven is used mostly in server-side project, because that's where Java is used most of the time.

2. Tools from other environments needs that environment

Running Maven on purely JS project would demand installing Java to use it. Yeoman on the other hand can be run using Node.js. Java would be unnecessary dependency for developer. Vice versa is also true.