Skip to content

Prevent compile time dependency of APT on docs artifact #984

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
odrotbohm opened this issue Dec 11, 2024 · 0 comments
Closed

Prevent compile time dependency of APT on docs artifact #984

odrotbohm opened this issue Dec 11, 2024 · 0 comments
Assignees
Labels
in: core Core module meta model in: documentation support Documentation generation type: bug Something isn't working
Milestone

Comments

@odrotbohm
Copy link
Member

Spring Modulith 1.3.0 introduced an APT to extract Javadoc from an application for use in generated documentation. The artifact depends on spring-modulith-docs in compile scope to refer to types that define the file structure generated and subsequently consumed by the docs artifact. This causes both the documentation and its transitive core artifact to always be pulled into compile scope, subsequently leading to the inclusion of the docs artifact in the application JAR created by the Spring Boot build plugin.

This actually causes GH-943 to be unreproducible on 1.3 as the core artifact is always pulled into compile scope by the core starter, despite being declared as a runtime dependency. We want to avoid that, in order to make the decision to depend on core in compile scope an explicit step.

Unfortunately, we cannot move the metadata types into the APT module as it also depends on a BuildSystemUtils type that we would need to move around.

We should instead simply shade the three classes into the APT so that it's basically dependencyless and does not trigger additional libraries being included into the production application.

@odrotbohm odrotbohm added in: documentation support Documentation generation in: core Core module meta model type: bug Something isn't working labels Dec 11, 2024
@odrotbohm odrotbohm added this to the 1.4 M1 milestone Dec 11, 2024
@odrotbohm odrotbohm self-assigned this Dec 11, 2024
odrotbohm added a commit that referenced this issue Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Core module meta model in: documentation support Documentation generation type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant