Skip to content

Commit 977f4e4

Browse files
authored
Merge pull request eugenp#4952 from asturcon/tutorials/mvnMultipleSrc
BAEL-1834 - Maven Project with Multiple src Directories
2 parents 534d574 + 15c7287 commit 977f4e4

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

‎maven/pom.xml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,24 @@
9494
</filesets>
9595
</configuration>
9696
</plugin>
97+
<plugin>
98+
<groupId>org.codehaus.mojo</groupId>
99+
<artifactId>build-helper-maven-plugin</artifactId>
100+
<version>${maven.build.helper.version}</version>
101+
<executions>
102+
<execution>
103+
<phase>generate-sources</phase>
104+
<goals>
105+
<goal>add-source</goal>
106+
</goals>
107+
<configuration>
108+
<sources>
109+
<source>src/main/another-src</source>
110+
</sources>
111+
</configuration>
112+
</execution>
113+
</executions>
114+
</plugin>
97115
</plugins>
98116
</build>
99117

@@ -102,6 +120,7 @@
102120
<maven.failsafe.version>2.21.0</maven.failsafe.version>
103121
<maven.verifier.version>1.1</maven.verifier.version>
104122
<maven.clean.version>3.0.0</maven.clean.version>
123+
<maven.build.helper.version>3.0.0</maven.build.helper.version>
105124
<resources.name>Baeldung</resources.name>
106125
</properties>
107126

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.baeldung.maven.plugins;
2+
3+
public class Foo {
4+
5+
public static String foo() {
6+
return "foo";
7+
}
8+
9+
}
10+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.baeldung.maven.plugins;
2+
3+
public class MultipleSrcFolders {
4+
5+
public static void callFoo() {
6+
Foo.foo();
7+
}
8+
9+
}

0 commit comments

Comments
 (0)