Is Maven really flexible?
Posted
by
Dima
on Stack Overflow
See other posts from Stack Overflow
or by Dima
Published on 2012-10-09T03:36:22Z
Indexed on
2012/10/09
3:36 UTC
Read the original article
Hit count: 123
maven
I understand how Maven works with .java files in src/java/main. But may it be used for a more general case? Let us put it more abstract: Suppose I already have some a.exe that read some (not necessarily only .java) sources from directories A1, A2, A3 and puts some files (maybe some are generated .java) to directories B1, B2. I also have some b.exe that currently reads files from B1, B2, B3 and generates something else. Some more similar steps. (A real life problem stands behind).
I would like to right POM.xml file so that maven will do this work. Is that possible? I assume that a.exe and b.exe should be warped as maven plugings. Next, in Maven docs I see :
<build>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<scriptSourceDirectory>${basedir}/src/main/scripts</scriptSourceDirectory>
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
<outputDirectory>${basedir}/target/classes</outputDirectory>
<testOutputDirectory>${basedir}/target/test-classes</testOutputDirectory>
...
</build>
What bothers me is that "sourceDirectory" looks by itself as a hard coded name. Will Maven accept A1 and A2 tags instead?
© Stack Overflow or respective owner