I want to compile only selected files or directories (including subdirectories) within source directory. I was pretty sure I can do this using <includes>
of maven-compiler-plugin
's configuration, but it seems to not work as I expect since it still compiles all classes into target/classes
. What is really strange, Maven output suggest that the setting actually does its work, because with:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<includes>
<include>com/example/dao/bean/*.java</include>
</includes>
</configuration>
</plugin>
I have:
[INFO] Compiling 1 source file to c:Projectsestargetclasses
but with no compiler's configuration I have:
[INFO] Compiling 14 source file to c:Projectsestargetclasses
In both cases however, all 14 classes are compiled into target/classes
as I mentioned. Can you explain that or suggest another solution to compile only selected files?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…