For frontend development with Maven I found it to be easiest to define a
custom lifecycle for a custom artifact type / packaging, e.g.
"angular-app", "angular-lib", "webpack-app" etc.
This way it is possible to specify a build flow which is more appropriate
for frontend development than the default lifecycle by specifying a
sensible set of plugin executions such as the frontend-maven-plugin.
The generated frontend artifact can then be used as dependency in other
maven modules and be unpacked with the maven-dependency-plugin to the
desired location.

On a more general note: in my opinion maven-tiles [1] is more appropriate
for this kind of scenarios by utilizing composition-over-inheritance.

I usually combine both approaches to specify a generalized build flow for
the frontend first with the custom lifecycle / artifact type and
maven-tiles to make customizations to this build flow.


[1] https://github.com/repaint-io/maven-tiles


On Sat, Nov 27, 2021, 18:08 Falko Modler <f.mod...@gmx.net> wrote:

> Hi,
>
> what also works in many cases is a profile with file activation, e.g. if
> there is src/main/kotlin add the kotlin plugin.
> You can even use flagfiles to control this, which isn't pretty but
> sometimes it makes sense
>
> Cheers,
>
> Falko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>

Reply via email to