Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxkratz/maven-code-gen-example
Example on how to use Maven to compile and trigger a custom code generator in one run.
https://github.com/maxkratz/maven-code-gen-example
ci code-gen code-generation code-generator continuous-integration eclipse java maven mdse
Last synced: 5 days ago
JSON representation
Example on how to use Maven to compile and trigger a custom code generator in one run.
- Host: GitHub
- URL: https://github.com/maxkratz/maven-code-gen-example
- Owner: maxkratz
- License: agpl-3.0
- Created: 2024-01-28T09:37:26.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-08-23T05:49:39.000Z (3 months ago)
- Last Synced: 2024-08-23T06:49:20.104Z (3 months ago)
- Topics: ci, code-gen, code-generation, code-generator, continuous-integration, eclipse, java, maven, mdse
- Language: Java
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Maven code generation example
This example shows how to configure a [Maven](https://maven.apache.org/) project to consider code generation classes and generated code.
The usual procedure is:1) Compiling the code generator itself
1) Running the code generator to, e.g., generate new java classes
1) Compile the whole project (including the previously generated classes)The example can be used to, for example, use custom code generators and their functionality to generate code withing a CI pipeline (without the need to run individual steps manually).
[![CI](https://github.com/maxkratz/maven-code-gen-example/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/maxkratz/maven-code-gen-example/actions/workflows/ci.yml)
## Structure
| Name | Type | Purpose |
| ------------------------------------------ | ---------------------- | ------------------------------------------------------------------- |
| [org.example.codegen](org.example.codegen) | Eclipse (java) project | Contains the sources of the custom code generator. |
| [ci.yml](.github/workflows/ci.yml) | File | Example GitHub Actions configuration to build and push the project. |
| [pom.xml](org.example.codegen/pom.xml) | File | Maven configuration file that contains the project's configuration. |## How to build
- Generate code + build the project: \
`$ mvn clean package`
- Build + install the project to the local `.m2/` folder: \
`$ mvn clean install`
- Change the version of the plug-in to a new semver (e.g., before publishing a new release): \
`$ mvn versions:set -DnewVersion=0.0.2-SNAPSHOT`## License
This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for more details.