Juha Syrjälä
Juha Syrjälä

Reputation: 34271

Make maven build fail created artifact contains certain classes

I have complex multi-pom setup that in the end will create an EAR package. Sometimes the dependencies are messed up and some unwanted dependencies like JUnit end up in the final EAR package.

Is there a way to make maven build fail if final artifact contains certain classes?

Upvotes: 0

Views: 76

Answers (2)

SpaceTrucker
SpaceTrucker

Reputation: 13556

You could use the maven-enforcer-plugin with a custom rule that you probably would have to write yourself. I haven't searched, but I don't think that such a rule exists yet.

Upvotes: 1

maba
maba

Reputation: 48045

Maybe not failing but you can exclude some jar-files that you know you will never use.

The maven-ear-plugin has a tag to use when excluding files, look here.

Use the <packagingExcludes/> tag to exclude JUnit for example.

Upvotes: 1

Related Questions