I am creating a non-java Maven artifact. In the pom.xml
I resolve some dependencies and then run a custom script using exec
plugin. Some files are created in a directory, but Maven does not see them when packaging them in a jar.
When I run mvn package
twice, the second run does include the resource files in the jar.
Any ideas why this is happening? The script is run during the compile
phase, so the files are already created when the package
phase is creating the jar.
This is the relevant (hopefully) part of my pom.xml
configuration:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>build-plugin</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>build_plugin.sh</argument>
<argument>${workspace}</argument>
<argument>${plugin}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>${project.basedir}/${outputPath}</directory>
<includes>
<include>**</include>
</includes>
<excludes>
<exclude>target/**</exclude>
</excludes>
</resource>
</resources>
All the variables and paths are valid, on the second run I am getting a jar with expected content. But not during the first.