Question

We have a project where we use protobufs. When we count the number of methods in generated protobuf .java files they contain around 1000 methods. But when we compile them into a jar and use the method counter (Is there a way to get count of number methods used in a jar file) it shows up around 40000 methods.

I assume that every sub class which we have contains the same number of methods each super class has. But its just a guess. Is there any way I can compile those in a better way than this?.

This is not a single small project. So changing into other protobuf builders is not a solution. I assume there should be a better way of making jars.

Was it helpful?

Solution

Have a look at Exclude unused parts of dependencies from jar (Maven) and configure Maven Shade minimizeJar to include class files. They may well be what you need if you are using Maven to build your software.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top