https://github.com/baloise/inlinesourcecodegenerator
generate java source file in a maven project with the generator written in java and included in the same project
https://github.com/baloise/inlinesourcecodegenerator
Last synced: 8 months ago
JSON representation
generate java source file in a maven project with the generator written in java and included in the same project
- Host: GitHub
- URL: https://github.com/baloise/inlinesourcecodegenerator
- Owner: baloise
- License: apache-2.0
- Created: 2017-11-13T09:30:38.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-01T14:21:13.000Z (over 7 years ago)
- Last Synced: 2025-01-03T19:26:30.586Z (over 1 year ago)
- Language: Java
- Size: 11.7 KB
- Stars: 2
- Watchers: 7
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: docs/CODEOWNERS
Awesome Lists containing this project
README
# inlinesourcecodegenerator
generate java source file in a maven project with the generator written in java and included in the same project
As anwser to https://stackoverflow.com/questions/2147115/generating-sources-by-running-a-projects-java-class-in-maven
- generated source is in src/main/java in a seperate package
- PRO : we can use the generator from inside the IDE and have the generated classes change
- CON : we check the generator code into the repo / habe to ignore it while committing
- generator is in seperate source folder with test scope
- PRO: generator source and deps don't go into prod jar
## Maven plugins used
| phase | plugin | what for |
| -------- | ------------ | ------------ |
| initialize | build-helper-maven-plugin | add src/main/generator with scope test |
| generate-sources | maven-compiler-plugin | testCompile classes under generator package |
| process-sources | exec-maven-plugin | execute generator |