-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Provide a way to customize layers with the Maven plugin #20295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'd been thinking about the layers configuration during the design of the API. Its unfortunately really hard to come up with a logic way to do it. I was originally thinking that we could define the layers in the oder that they should appear and define the items that they capture. For example: <layers>
<layer>
<name>my-libs</name>
<libs>
<lib>org.acme:my-lib:*</lib>
</libs>
...
</layer>
</layers> The problem with this approach is it's quite hard to define catch-all patterns that are out of order. For example, if we want to recreate The best option I could come up with is to define the layer names and their order separately from the pattern matching config. <layer-config>
<layers>
<layer>dependencies</layer>
<layer>snapshot-dependencies</layer>
<layer>resources</layer>
<layer>application</layer>
</layers>
<contents>
<content>
<libraries>
<library>*:*:*SNAPSHOT</library>
</libraries>
<destination>snapshot-dependencies</destination>
</content>
<content>
<libraries>
<library>*:*:*</library>
</libraries>
<destination>dependencies</destination>
</content>
<content>
<resources>
<resource>static/*</resource>
</resources>
<destination>resources</destination>
</content>
<!-- anything not caught ends up in the last layer -->
</contents>
</layer-config> I'm not totally convinced that this isn't too confusing, but I'm not sure how else we can support complex matching rules. |
The more I think of it and the more I find some analogy with the A separate XML file tailored for layering can have a dedicated XSD with documentation. Maven is pretty limited with regards to documenting complex POJO structure (and I doubt that all IDEs have the same level of support in auto-completion). The assembly plugin also has a concept of predefined descriptors that would match with opinions in terms of layering. |
Regarding the ordering of the layers, I wonder if there's a way to have an optional configuration option that lets you define the order if is is different from the order that they were defined in |
<layers>
<layer>dependencies</layer>
<layer>snapshot-dependencies</layer>
<layer>resources</layer>
<layer>application</layer>
</layers> I find this ordering confusing. I'd expect the layers to be listed from most to least frequently changing but the above is the reverse of that. In other words, I think of the layers as a representation of what the image will look like, rather than a representation of the order in which they'll be written. |
No description provided.
The text was updated successfully, but these errors were encountered: