I'm currently developing an Angular + Spring Boot application. I manage both projects with maven. For Maven I have a plugin that generates DTOs for Java AND TypeScript/Angular. Dealing with the genrated Java sources is no problem as Maven offers great support (I created a seperate Maven module where the Java sources get generated).
The problem now is to integrate the generated TypeScript sources with my Angular project. Currently I just let the plugin write the TypeScript sources into a project folder.
But I wondered if there is a cleaner way of integrating generated TypeScript sources into an Angular project. Has anyone found a clean way for this?
Asked
Active
Viewed 268 times
1

mrdlink
- 266
- 4
- 15
-
*I created a seperate Maven module where the Java sources get generated* you didnt have to. – Antoniossss Apr 03 '20 at 11:09
-
*Currently I just let the plugin write the TypeScript sources into a project folder.* is it going to be shared among other applications? – Antoniossss Apr 03 '20 at 11:10
-
No it is just one angular application. – mrdlink Apr 03 '20 at 13:30
-
Than why would you want to do that? If there is no sharing, than this brings no value. – Antoniossss Apr 03 '20 at 14:15
-
Because IntelliJ goes nuts if there are about 120 new files generated at once directly in a source folder. I think any IDE would go wild about that. And I have to generate these DTOs anytime my database changes. And YES I know it might be poor design, but that's what I have to deal with at the time. – mrdlink Apr 03 '20 at 14:21
-
I have over 400 custom assertion classes that are generated on build and Intellij works fine with it. What you can try to do is to generate to another source directory and mark that directory as "generated sources root". Maybe this will help for whatever reasons. – Antoniossss Apr 03 '20 at 14:28