8000 Add `RepackageModule` to build assemblies based on Spring Boot tools by lefou · Pull Request #4489 · com-lihaoyi/mill · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add RepackageModule to build assemblies based on Spring Boot tools #4489

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

Merged
merged 17 commits into from
May 5, 2025

Conversation

lefou
Copy link
Member
@lefou lefou commented Feb 6, 2025

This adds a mill.javalib.repackage.RepackageModule which enhances a Module with a repackagedJar task to produce self-executable JAR files. If the module is a JavaModule everything should work out of the box. Otherwise, the use may need to override various tasks, which is analogue to using RunModule or AssemblyModule.

The Spring-Boot tools are encapsulated into a separate mill.javalib.spring.boot.SpringBootToolsModule to avoid instantiating multiple instance. A pre-configured version using the tools version present at built-time is available as ExternalModule and used by default.

Fix #4479

@lefou
Copy link
Member Author
lefou commented Feb 6, 2025

This is an early draft for a SpringBootAssemblyModule

This derives from JavaModule for now. I tried to just derive from AssemblyModule or RunModule, but couldn't get it right. Since we revisit the module structure anyways, I think this can be tried later again.

The Spring-Boot tools are encapsulated into a separate Module to avoid multiple instance. A pre-setup version using the tools that were available at built-time is available as ExternalModule and used by default.

@lefou lefou force-pushed the spring-boot-assembly branch from 7003265 to 1d41d44 Compare February 10, 2025 12:27
lefou and others added 6 commits February 12, 2025 06:28
This derives from `JavaModule` for now. I tried to just derive from AssemblyModule or RunModule, but could get it right. Since we revisit the module structure anyways, I think this can be tried later again.

The Spring-Boot tools are encampsulated into a separate Module to avoid multiple instance. A pre-setup version using the tools that were available at built-time is available as `ExternalModule` and used by default.
@lefou lefou force-pushed the spring-boot-assembly branch from 1d41d44 to c34f430 Compare May 4, 2025 13:01
@lefou lefou mentioned this pull request May 4, 2025
@lefou lefou marked this pull request as ready for review May 4, 2025 14:52
@lihaoyi
Copy link
Member
lihaoyi commented May 5, 2025

@lefou I wonder if we should give SpringBootAssemblyModule a more generic name? Having an assembly that doesn't merge classpath entries seems like something that could be generally useful, and not limited to spring boot

@lefou
Copy link
Member Author
lefou commented May 5, 2025

@lefou I wonder if we should give SpringBootAssemblyModule a more generic name? Having an assembly that doesn't merge classpath entries seems like something that could be generally useful, and not limited to spring boot

Yeah, the name is quite long. And beside the tools coming under the Spring Boot brand, the utility is independent. We could name it RepackageModule and the task repackage, which is also the name of the Maven goal (spring-boot:repackage, whereas in Gradle it's assemble). All the spring-boot-tools specific stuff is already handled by the external SpringBootToolsModule, so a user doesn't need to manage anything Spring related.

@lihaoyi
Copy link
Member
lihaoyi commented May 5, 2025

Maybe we can all it RepackageModule and document it next to the AssemblyModule in the Packaging and Publishing doc pages, and link to that from the part of the Java Web Build Examples page discussing spring-boot?

@lihaoyi
Copy link
Member
lihaoyi commented May 5, 2025

That's assuming that this isn't hard-coded to be used for spring boot of course. If it does do stuff specific to spring-boot, we should just leave the name as it is

@lefou
Copy link
Member Author
lefou commented May 5, 2025

The repackaging does not require the project to be a Spring project. The documentation is already in the package and publish section, we just need to move it up.

@lefou lefou force-pushed the spring-boot-assembly branch from 2d8cdd6 to 48a6429 Compare May 5, 2025 12:31
@lefou lefou marked this pull request as draft May 5, 2025 12:35
@lefou
Copy link
Member Author
lefou commented May 5, 2025

Reworked Module and updated PR description.

@lefou lefou marked this pull request as ready for review May 5, 2025 12:51
@lefou lefou changed the title Add Spring Boot Assembly Module Add RepackageModule to build assemblies based on Spring Boot tools May 5, 2025
@lefou lefou merged commit 329658d into com-lihaoyi:main May 5, 2025
38 checks passed
@lefou lefou deleted the spring-boot-assembly branch May 5, 2025 13:54
@lefou lefou added this to the 1.0.0-RC1 milestone May 5, 2025
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.

Improve Spring-Boot integration, support for Spring-Boot Assemblies
2 participants
0