I am trying to use the maven-antrun-plugin
to copy generated .java
files to my current source directory. My problem is that one part of the path directory I want to copy is generated.
The path I want to copy look like this :
${project.build.directory}/working/<GENERATED_DIRECTORY_I_DONT_KNOW_THE_NAME>/${project.artifactId}-${project.version}/ejbModule
and from this point I want to copy all .java files with its subdirectories (to keep the tree of the packages.
See my above plugin configuration :
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>ejbdeploy-copy</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Moving stubs file to source project.</echo>
<copy todir="${project.build.sourceDirectory}">
<fileset dir="${project.build.directory}/working/**/${project.artifactId}-${project.version}/ejbModule">
<include name="**/*.java"/>
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
The thing is that the maven-antrun-plugin cannot convert my **
to the generated directory name.
I tried with this kind of configuration but it didn't work :
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>ejbdeploy-copy</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo>Moving stubs file to source project.</echo>
<copy todir="${project.build.sourceDirectory}">
<fileset dir="${project.build.directory}">
<include name="**/*.java"/>
<exclude name="**/ejbModule/"/>
</fileset>
</copy>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
Any ideas ?