How to get Maven testResources directories inside pom
In the Maven pom.xml, I can get some of the build values that were defined in the build section. for example ${project.build.testSourceDirectory}
:
<build>
<directory>${project.basedir}/target</directory>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
<testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>
<sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/java/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>${project.basedir}/src/test/resources</directory>
</testResource>
</testResources>
...
Is there anyway to get the value of the testResources directory which is a child of the testResource? I tried ${project.build.testResources[0].directory}
it but it doesn't work.
source to share
Try it.
project.testResources[0].directory
He works in this environment.
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Java version: 1.8.0_45-internal, vendor: Oracle Corporation
OS name: "linux", version: "3.13.0-46-generic", arch: "amd64", family: "unix"
source to share