Arun S
Arun S

Reputation: 135

Maven - Generate test jar without its classifier name (tests)

I'm currently generating a test jar using maven-jar-plugin with test-jar as goal. This is producing the test jar that I want but the file name has a -tests classifier suffixed. I would want my test jar to be generated without the -test on it. I looked at the source and it automatically adds classifier, tests, for this goal. Wanted to check if there is any other way to prevent this from happening. Say, for instance, making the default jar (generated by setting goal=jar on pom.xml) that is produced, to include src/test in addition to src/main contents (if this can be done, can you please give some pointers on how to do this)?

Thanks.

Upvotes: 1

Views: 450

Answers (1)

bmargulies
bmargulies

Reputation: 100023

The name of the jar in the repository is not your business. If you need to change the name in your target directory, change the finalName parameter on the maven-jar-plugin.

If you need to change the name downloaded, use the appropriate parameters to the maven-dependency-plugin.

You can't change the name in ~/.m2/repository.

Upvotes: 1

Related Questions