Skip to content
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

Spring Boot gradle/maven plugin: bootRun produces massively long classpath entries #8320

Closed
mmoayyed opened this issue Feb 17, 2017 · 2 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@mmoayyed
Copy link
Contributor

mmoayyed commented Feb 17, 2017

Howdy Spring Boot,

Per the guidelines here, I made the following post available on SO but given lack of response, I suspect it's got more serious causes.

Could you please review this bug report:

I have not found a reasonable workaround. Did not duplicate the text/issue description here as I think SO should describe things correctly but if there is anything I can help clarify, please let me know.

Note that this issue persists with 1.5.1 as well, and is apparent on both mac and windows platforms. It may also be related to the specific "overlay" nature of the sample project.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 17, 2017
@wilkinsona
Copy link
Member

You're not using bootRun as intended, and the fact that it works when you only have a single war dependency is by luck rather than by design.

bootRun is intended to run the application in the current project but your cas project doesn't directly contain an application. Instead, it depends on cas-server-webapp which is an executable war file. Launching it is only successful because you've set mainClass to org.springframework.boot.loader.WarLauncher which is in the executable war. This results in the creation of a custom class loader than can load classes from WEB-INF/classes and all of the jars in WEB-INF/lib.

When you add an additional dependency, they're all added to bootRun's class path and are visible to the system class loader. You now have two copies of many of the application's classes available at the same time. Those on Boot's custom class loader in WEB-INF/classes and jars in WEB-INF/lib and those on the class path of the system class loader. All bets are off at this point.

It's not really clear to me what you're trying to do, but it is clear that you shouldn't be using bootRun in the way that you are as it's not intended for running an already-built, executable jar or war.

If you'd like some more help, please feel free to chat on Gitter or to ask another question on Stack Overflow that takes into account the explanation above.

@wilkinsona wilkinsona added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 17, 2017
@mmoayyed
Copy link
Contributor Author

Thank you Andy. I'll review and may be in touch via gitter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants