0

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?

Jean-Rémy Revy
  • 5,607
  • 3
  • 39
  • 65
Juha Syrjälä
  • 33,425
  • 31
  • 131
  • 183

2 Answers2

1

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.

maba
  • 47,113
  • 10
  • 108
  • 118
1

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.

SpaceTrucker
  • 13,377
  • 6
  • 60
  • 99