You can use the maven-jar-plugin for this task by specifying a classesDirectory:
Directory containing the classes and resource files that should be packaged into the JAR.
By default, this points to ${project.build.outputDirectory} in order to make a JAR of the classes and resources of your entire project.
Within this folder, you can then select what specific resource you want to include with the includes parameter. An example of configuration would be the following:
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>init-jar</id>
<phase>initialize</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${basedir}/path/to/folder</classesDirectory>
<includes>
<include>resource.txt</include>
</includes>
<outputDirectory>${project.build.directory}</outputDirectory>
<finalName>resource</finalName>
</configuration>
</execution>
</executions>
</plugin>
This will make a JAR out of the file ${basedir}/path/to/folder/resource.txt inside the build folder. This JAR will be named resource.jar, as per the configured finalName. The execution is bound to the initialize phase since you want to create this JAR at the beginning of the build.