maven-code-gen-example/org.example.codegen/pom.xml

91 lines
2.7 KiB
XML

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>org.example.codegen</artifactId>
<name>Example Code Generator</name>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.version>3.12.1</maven.compiler.version>
<build.helper.maven.version>3.5.0</build.helper.maven.version>
<java.version>17</java.version>
<maven.clean.version>3.3.2</maven.clean.version>
<exec.maven.version>3.2.0</exec.maven.version>
</properties>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.clean.version}</version>
<configuration>
<filesets>
<fileset>
<directory>gen</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<release>${java.version}</release>
</configuration>
<executions>
<execution>
<id>pre-compile</id>
<phase>generate-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build.helper.maven.version}</version>
<executions>
<execution>
<id>add-sources</id>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>gen/</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec.maven.version}</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>org.example.codegen.CodeGenerator</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>