-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Support for custom repackaging to change loader classes #7263
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
Conversation
0d2ca26
to
470bf49
Compare
Latest commit reverts "layout" in Maven and Gradle config to be an enum again. Users have to provide a |
c7e8198
to
1490c1c
Compare
Instead of a fixed enum of layout types, user can provide custom layouts via implementations of LayoutFactory in spring.factories.
A layout can also optionally change the loader jar that is unpacked in the root of the repackaged archive by implementing a new method in Layout.
This makes the autocompletion for pom.xml and (maybe) build.gradle easier for most users, but at the cost of a slightly odd API for deriving Layout from LayoutType.
As a courtesy to the user, if there is only one LayoutFactory defined in spring.factories, then there is no need to explicitly configure it.
It's simpler if the build tools just use a factory if one is provided otherwise derive the layout from its type.
1490c1c
to
24ec410
Compare
Allow support for custom Repackager implementations with both the Maven and Gradle plugin. Subclasses of `Repackager` can now be specified to allow customization of the layout and loader classes. See spring-projectsgh-7263
Add Maven and Gradle documentation for the updated Repackager support. See spring-projectsgh-7263
Add a sample that shows how a custom Repackager can be used with both Maven and Gradle. Closes spring-projectsgh-7263
@dsyer I'd like to change this a little so that instead of a custom Can you take a look at this branch and let me know if it will work for you? If so I'll merge it next week. |
I suppose that is a more liberal approach than what I proposed (something I wasn't trying to achieve). It works, but I'm not sold yet because the |
Another comment: it's probably good insurance to have a default |
OK, let me have another go. |
Pull up common timeout code into Repackager and remove the need for custom subclasses. See spring-projectsgh-7263
Allow support for custom Lyout implementations with both the Maven and Gradle plugin. Implementations of `LayoutFactory` can now be specified to allow customization of the layout. In addition a layout may now implement `CustomLoaderLayout` if it wishes to write custom loader classes. See spring-projectsgh-7263
Add a sample that shows how a custom LayoutFactory can be used with both Maven and Gradle. Closes spring-projectsgh-7263
@dsyer What about this version. The The So:
|
That works for me. A default layout factory still seems like a good idea, just in case anyone needs it, but I don't think it's a big deal (they are easy to write). |
OK, I'll add a |
Pull up common timeout code into Repackager and remove the need for custom subclasses. See gh-7263
Allow support for custom Lyout implementations with both the Maven and Gradle plugin. Implementations of `LayoutFactory` can now be specified to allow customization of the layout. In addition a layout may now implement `CustomLoaderLayout` if it wishes to write custom loader classes. See gh-7263
* gh-7263-2: Add custom LayoutFactory sample Support custom fat jar layouts Rework Repacakger timeout code
A layout can also optionally change the loader jar that is unpacked in the
root of the repackaged archive by implementing a new method in Layout.