Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does maven reusable resource project possible?

Is there any ability to build maven artifact which will contain only resources but no sources and which can be reused by other projects?

Motivation is the following. I have a library which contains only html/css/javascript code. This library must be packed as resources into war project. As for now I build web archive with resources by single pom. But am I able to separate html/css/javascript code into new artifact and reuse it in several war projects?

like image 731
Volodymyr Frolov Avatar asked Feb 25 '10 20:02

Volodymyr Frolov


People also ask

Can Maven plugins be reused?

Almost any action that you can think of performing on a project is implemented as a Maven plugin. Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects.

Does Maven have automatic parenting?

Automatic parent versioning − No need to specify the parent in the sub module for maintenance. Parallel builds − It analyzes the project dependency graph and enables you to build schedule modules in parallel. Using this, you can achieve the performance improvements of 20-50%.

Can a Maven project have multiple pom files?

Yes you can use Maven Profiles to manage this. Obviously you can tweak this approach to suit your needs however works best.


2 Answers

Use Maven Overlays. See Manipulating WAR Overlays for more examples.

like image 95
Pascal Thivent Avatar answered Sep 27 '22 16:09

Pascal Thivent


You can do it with the Maven assembly plugin.

like image 27
Péter Török Avatar answered Sep 27 '22 15:09

Péter Török