Skip to content

plugins: support for overriding layout-provided launcher class #2620

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

Closed
wants to merge 1 commit into from

Conversation

patrikbeno
Copy link

Spring Boot plugins "hijack" application's manifest by redirecting Main-Class attribute to a layout-provided launcher class and embedding some core Spring Boot Loader classes. Original Main-Class attribute is copied to Start-Class attribute which is handled by loader.

The problem is, you might need to customize default launcher behavior, but the plugins do not provide any means.

For wider context, see https://github.com/patrikbeno/spring-boot/wiki/Requirements

@philwebb
Copy link
Member

Have you signed the CLA?

@philwebb
Copy link
Member

It feels a little odd to provide the option to override the launcher class without also offering a way to add custom launcher classes. Are you usually writing your custom launcher class inside your application? Or do you have some other process that adds the class files to the JAR?

We'll also need to consider the Maven plugin as well if we do make the change.

@patrikbeno
Copy link
Author

Yes, CLA signed.

Maven plugin updated, too. See RepackageMojo. Or did you mean something else?

Sure, overriding launcher class is something you do not need usually. But it's nice to have an option. I only needed it once. That's enough for me to be bothered with this.

@philwebb
Copy link
Member

Oh yes, I see the Mojo was also updated. I just missed that last night when reviewing.

@patrikbeno
Copy link
Author

I suggest we close this and go with #2629

@patrikbeno
Copy link
Author

Yes, @philwebb, reopen is a good idea. While #2629 does indeed provide means to customize launcher, it may not be as flexible as providing plugin with your own customized class already available in your own module (and usually extending the default launcher associated with a selected layout).

However, assuming #2629 is sort of accepted (scheduled for 1.3.0), I have some issues with automatic merging of this particular PR. I suggest I incorporate these changes in #2629, if you agree. Then we can actually close this PR as obsolete.

Let me know.

@patrikbeno
Copy link
Author

Closing. See #2629 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants