tahrir
tahrir copied to clipboard
Proguard as a maven plugin
Proguard as a maven plugin forces the following issues:
- Proguard version last supported is 4.3, I have tried using other variants of the proguard plugin like com.github.wvengen which supports 4.5, but v4.5 doesn't support Java 7 either.
Simplest solution that can be implemented : Replace the proguard-4.3.jar with v4.10 but labelled proguard-4.3.jar so that Maven executes the v4.10 jar.
Where can the proguard-4.3.jar be found? /
Your maven repo on Linux without sudo would be at : /home/
- Since the maven repositories change from system to system and the Runtime jar file of JRE is renamed to classes.jar on a MacOS, extensive changes have to be performed on the pom.xml file for successful proguard builds.
Solution : We could pool in all the libraries into a lib folder in the root directory of the project and add the rt.jar file or classes.jar file depending on whether it's a non-Mac system or a Mac system.
Slightly complex solution : Have a separate maven profile for each dev so that execution is easy. This would be cumbersome as each command's execution would require the profile tag.
Alternative solution : Remove proguard as a maven task and use it manually once the finished with-dependencies jar file. A proguard.cfg file can be easily written which will be placed in the root directory. Very few proguard commands have to be run for the same effect.
- Since I'm new to the project I'm not quite sure how the classes are linked to each other. I have received quite a few warnings while using proguard. Most of them are useless, but a couple are causing errors in the shrunk jar file.
Here is the list : https://dl.dropboxusercontent.com/u/28378535/warnings.log
If you have a hunch of what might be causing the following errors in the shrunk file, and you can find out how they're related to one of the warnings in the warnings.log file, do let me know.
Errors :
Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:132)
at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:58)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:122)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:93)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:52)
at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:77)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
at org.slf4j.impl.StaticLoggerBinder.
@sanity Any idea on the status of this issue?