Spring Boot Angular Build Order

Viewed 34

I got a application consisting of three projects: DB, Backend, Frontend.

Backend is Spring Boot, Frontend is an Angular application.

The build results from the Angular Frontend are used in Backend by means of maven-resources-plugin copy-resources. The backend is packaged using spring-boot-maven-plugin.

Therefore the build order is DB, Frontend, Backend.

This is all nice and sunshine everywhere.

Now I want to build an OpenAPI spec from the definitions in Backend and use it to build the API client code for the Frontend. The springdoc-openapi-maven-plugin will build the spec while generate-api-client-code will generate my client code.

Sadly, the required build order for this is DB, Backend, Frontend.

I tried using the maven-assembly-plugin with this build order to get a monolithic JAR when building the Frontend. This did not work because it interferes with the Spring Boot entry point.

Now I wonder: How would someone more accustomed to Maven solve this problem? Should I write an unbound goal generate-api and have it be executed manually? Should I build the backend twice, one time for getting the API spec and a second time to include the resources? Is there any sane way of doing this?

0 Answers
Related