I have a Maven project that uses the exec-maven-plugin
to execute a class with a main method, and this generates an output file in the target directory. The configuration looks like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.5.0</version>
<executions>
<execution>
<id>process-execution</id>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.example.MainClass</mainClass>
<systemProperties>
<systemProperty>
<key>INPUT_FILE_PATH</key>
<value>${basedir}/src/main/resources/input_file.csv</value>
</systemProperty>
<systemProperty>
<key>OUTPUT_FILE_PATH</key>
<value>${project.build.directory}/output_file.json</value>
</systemProperty>
</systemProperties>
</configuration>
</plugin>
I want to be able to package and deploy this output file (output_file.json)
as a separate jar to the package repository along with the standard jar file built with the project classes.
Is there a way to get this done? Perhaps with the maven-assembly-plugin
?