Maven compile with multiple src directories
You can add a new source directory with build-helper:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/generated</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Maven can't build a project with multiple source directories
Your parent-pom shows <packaging>pom</packaging>
so the sources you define in the parent pom will not be compiled.
How to add an extra source directory for maven to compile and include in the build jar?
You can use the Build Helper Plugin, e.g:
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>some directory</source>
...
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Related Topics
Finding the Second Highest Number in Array
What Is the Purpose of @Namedarg Annotation in Javafx 8
How to Compile & Run Java Program in Another Java Program
Get MAC Address on Local MAChine with Java
Java 8: Difference Between Method Reference Bound Receiver and Unbound Receiver
How to Pass Arithmetic Operators to a Method in Java
Noclassdeffounderror in Java: Com/Google/Common/Base/Function
Java Inetaddress.Getlocalhost(); Returns 127.0.0.1 ... How to Get Real Ip
How Does Java Resolve a Relative Path in New File()
Convert Escaped Unicode Character Back to Actual Character
Java Inheritance - Instance Variables Overriding
How to Calculate a Time Span in Java and Format the Output
Read Whole Text Files from a Compression in Spark
Difference Between Year-Of-Era and Week-Based-Year