Why use Yeoman's generators instead of Maven's archetypes?
Asked Answered
K

1

8

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.

Kester answered 17/6, 2015 at 10:24 Comment(4)
Believe in yourself, you can always answer your questions. You just have to be patient and do the work :)Midnight
Of course, but I meant to do it quickly :) I think that the community, among other, serves this purpose.Kester
There is no such thing as 'it is necessary', it is determined by the use case. Both can generate projects from templates, and it's all up to the template. Check blog.akquinet.de/2011/02/11/mavenizing-javascript-projectsMidnight
I wondered the same thing, i think its because people working on JavaScript projects didn't want to install Java & Maven just to generate code. So they decided to use a generator that would run on tools they already had installed such as node.Joeljoela
M
0

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.

Matz answered 1/4, 2020 at 14:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.