Use type test-jar as suggested by Karl-Heinz Mabaise, see end of page of https://maven.apache.org/guides/mini/guide-attached-tests.html as well.