-2

Maven 3.

2 modules: M1 and M2

There is a class in M2 named B.class which will reference A.class, A.class is in the first module M1. M1 has many classes, such as 100 classes as example.

When I execute command under M2, is it possible only package B.class and A.class to the jar rather than B.class and all classes in M1 ?

mvn clean package
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197

1 Answers1

0

The Maven shade plugin can build minimised jars only containing the classes you use.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142