There is a clear solution for sharing the common test code between maven projects using test-jar goal of maven-jar-plugin plugin (see here).
Using maven-dependency-plugin we can put the resource needed in the right directory, only modifying the pom on dependent project is needed:
org.apache.maven.plugins
maven-dependency-plugin
generate-test-resources
unpack
dependeeGroupId
dependeeArtifactId
dependeeVersion
test-jar
${project.build.directory}/test-classes
resourceNeeded.txt
true
type is used to get test resource
outputDirectory is used to put the resource usable in tests
Documentation here: https://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html