I actually managed to get past this error, I shamelessly forgot to take care
of my ProGuard parameters. My POM now looks includes all of the pertinent
options, however, I continue to get errors, and I really have no clue what
they mean:
Here they are:
[proguard] Warning: org.apache.tools.ant.Main: can't find superclass or
interface org.apache.tools.ant.launch.AntMain
[proguard] Warning:
org.hibernate.cache.TreeCacheProvider$TransactionManagerLookupAdaptor: can't
find superclass or interface org.jboss.cache.TransactionManagerLookup
[proguard] Warning: org.dom4j.xpath.DefaultNamespaceContext: can't find
superclass or interface org.jaxen.NamespaceContext
[proguard] Warning:
net.sf.jasperreports.engine.design.JRJdtCompiler$CompilationUnit: can't find
superclass or interface
org.eclipse.jdt.internal.compiler.env.ICompilationUnit
[proguard] Warning:
net.sf.jasperreports.compilers.JRGroovyCompiler$ClassCollector: can't find
superclass or interface
org.codehaus.groovy.control.CompilationUnit$ClassgenCallback
[proguard] Warning:
org.hibernate.cache.OptimisticTreeCacheProvider$TransactionManagerLookupAdaptor:
can't find superclass or interface org.jboss.cache.TransactionManagerLookup
[proguard] Warning:
net.sf.jasperreports.engine.util.BreakIteratorSplitCharacter: can't find
superclass or interface com.lowagie.text.SplitCharacter
[proguard] Warning:
org.hibernate.cache.OptimisticTreeCache$NonLockingDataVersion: can't find
superclass or interface org.jboss.cache.optimistic.DataVersion
[proguard] Warning: org.apache.commons.beanutils.BeanMap$Entry: can't find
superclass or interface
org.apache.commons.collections.keyvalue.AbstractMapEntry
[proguard] Warning: org.dom4j.xpp.ProxyXmlStartTag: can't find superclass
or interface org.gjt.xpp.XmlStartTag
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find superclass or interface org.apache.xml.resolver.Catalog
[proguard] Warning:
org.apache.tools.ant.types.resolver.ApacheCatalogResolver: can't find
superclass or interface org.apache.xml.resolver.tools.CatalogResolver
[proguard] Warning:
org.hibernate.cache.OptimisticTreeCache$CircumventChecksDataVersion: can't
find superclass or interface org.jboss.cache.optimistic.DataVersion
[proguard] Warning:
com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter: can't find
superclass or interface
org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
[proguard] Warning: org.dom4j.datatype.DatatypeElement: can't find
superclass or interface com.sun.msv.datatype.SerializationContext
[proguard] Warning: org.dom4j.datatype.DatatypeElement: can't find
superclass or interface org.relaxng.datatype.ValidationContext
[proguard] Warning: org.dom4j.swing.XMLTableDefinition: can't find
superclass or interface org.jaxen.VariableContext
[proguard] Warning: com.mysql.jdbc.integration.c3p0.MysqlConnectionTester:
can't find superclass or interface com.mchange.v2.c3p0.QueryConnectionTester
[proguard] Warning:
net.sf.jasperreports.engine.export.JRPdfExporter$LocalFontMapper: can't find
superclass or interface com.lowagie.text.pdf.FontMapper
[proguard] Warning:
org.hibernate.bytecode.javassist.ProxyFactoryFactoryImpl$1: can't find
superclass or interface javassist.util.proxy.MethodFilter
[proguard] Warning:
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer: can't find
superclass or interface javassist.util.proxy.MethodHandler
[proguard] Warning: org.dom4j.datatype.DatatypeAttribute: can't find
superclass or interface com.sun.msv.datatype.SerializationContext
[proguard] Warning: org.dom4j.datatype.DatatypeAttribute: can't find
superclass or interface org.relaxng.datatype.ValidationContext
[proguard] Warning: org.apache.log4j.net.JMSSink: can't find superclass or
interface javax.jms.MessageListener
[proguard] Warning: net.sf.jasperreports.engine.design.JRJdtCompiler$2:
can't find superclass or interface
org.eclipse.jdt.internal.compiler.ICompilerRequestor
[proguard] Warning: net.sf.jasperreports.engine.design.JRJdtCompiler$1:
can't find superclass or interface
org.eclipse.jdt.internal.compiler.env.INameEnvironment
[proguard] Warning:
org.hibernate.bytecode.javassist.ProxyFactoryFactoryImpl$PassThroughHandler:
can't find superclass or interface javassist.util.proxy.MethodHandler
[proguard] Warning: org.jdesktop.swingx.auth.LoginService$1: can't find
superclass or interface org.jdesktop.swingworker.SwingWorker
[proguard] Warning: net.sf.cglib.transform.hook.AbstractPreProcessor: can't
find superclass or interface org.codehaus.aspectwerkz.hook.ClassPreProcessor
[proguard] Warning: net.sf.cglib.transform.hook.AsmClassLoaderPreProcessor:
can't find superclass or interface
org.codehaus.aspectwerkz.hook.ClassLoaderPreProcessor
[proguard] Warning:
org.hibernate.cache.OptimisticTreeCache$DataVersionAdapter: can't find
superclass or interface org.jboss.cache.optimistic.DataVersion
[proguard] Warning:
com.mysql.jdbc.integration.jboss.MysqlValidConnectionChecker: can't find
superclass or interface
org.jboss.resource.adapter.jdbc.ValidConnectionChecker
[proguard] Warning:
org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer$1: can't find
superclass or interface javassist.util.proxy.MethodFilter
[proguard] Warning:
org.hibernate.tool.instrument.cglib.InstrumentTask$CustomClassDescriptor:
can't find referenced method 'java.lang.String[]
getClassInfo(org.objectweb.asm.ClassReader)' in class
net.sf.cglib.core.ClassNameReader
[proguard] Warning:
net.sf.jasperreports.charts.fill.JRFillTimeSeriesDataset: can't find
referenced method 'TimeSeries(java.lang.String,java.lang.Class)' in class
org.jfree.data.time.TimeSeries
[proguard] Warning: org.apache.commons.logging.impl.Log4JCategoryLog: can't
find referenced method 'void
log(java.lang.String,org.apache.log4j.Level,java.lang.Object,java.lang.Throwable)'
in class org.apache.log4j.Category
[proguard] Warning: org.apache.commons.logging.impl.Log4JCategoryLog: can't
find referenced method 'boolean isEnabledFor(org.apache.log4j.Level)' in
class org.apache.log4j.Category
[proguard] Warning: org.hibernate.bytecode.cglib.CglibClassTransformer:
can't find referenced method 'java.lang.String[]
getClassInfo(org.objectweb.asm.ClassReader)' in class
net.sf.cglib.core.ClassNameReader
[proguard] Warning: org.hibernate.bytecode.cglib.CglibClassTransformer:
can't find referenced method
'ClassReaderGenerator(org.objectweb.asm.ClassReader,org.objectweb.asm.Attribute[],boolean)'
in class net.sf.cglib.transform.ClassReaderGenerator
[proguard] Warning: org.hibernate.bytecode.cglib.CglibClassTransformer:
can't find referenced method 'void
generateClass(org.objectweb.asm.ClassVisitor)' in class
net.sf.cglib.transform.TransformingClassGenerator
[proguard] Warning: net.sf.ehcache.hibernate.SingletonEhCacheProvider:
can't find referenced method 'CacheException(java.lang.Exception)' in class
org.hibernate.cache.CacheException
[proguard] Warning: org.apache.commons.beanutils.BeanMap$Entry: can't find
referenced method 'java.lang.Object getKey()' in class
org.apache.commons.beanutils.BeanMap$Entry
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find referenced method 'java.lang.String
normalizeURI(java.lang.String)' in class
org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find referenced field 'org.apache.xml.resolver.CatalogManager
catalogManager' in class org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find referenced field 'java.net.URL base' in class
org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find referenced method 'java.lang.String
normalizeURI(java.lang.String)' in class
org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find referenced method 'java.lang.String
normalizeURI(java.lang.String)' in class
org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find referenced field 'org.apache.xml.resolver.CatalogManager
catalogManager' in class org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning: org.apache.tools.ant.types.resolver.ApacheCatalog:
can't find referenced field 'java.net.URL base' in class
org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning:
org.apache.tools.ant.types.resolver.ApacheCatalogResolver: can't find
referenced method 'org.apache.xml.resolver.Catalog getCatalog()' in class
org.apache.tools.ant.types.resolver.ApacheCatalogResolver
[proguard] Warning:
org.apache.tools.ant.types.resolver.ApacheCatalogResolver: can't find
referenced method 'void parseCatalog(java.lang.String)' in class
org.apache.tools.ant.types.resolver.ApacheCatalog
[proguard] Warning: net.sf.jasperreports.engine.export.JRXlsExporter: can't
find referenced method 'void setColumnHidden(short,boolean)' in class
org.apache.poi.hssf.usermodel.HSSFSheet
[proguard] Warning: net.sf.jasperreports.engine.export.JRXlsExporter: can't
find referenced method 'void setAnchorType(int)' in class
org.apache.poi.hssf.usermodel.HSSFClientAnchor
[proguard] Warning: net.sf.jasperreports.engine.export.JRXlsExporter: can't
find referenced method 'int addPicture(byte[],int)' in class
org.apache.poi.hssf.usermodel.HSSFWorkbook
[proguard] Warning: net.sf.jasperreports.engine.export.JRXlsExporter: can't
find referenced method 'org.apache.poi.hssf.usermodel.HSSFPicture
createPicture(org.apache.poi.hssf.usermodel.HSSFClientAnchor,int)' in class
org.apache.poi.hssf.usermodel.HSSFPatriarch
[proguard] Warning: net.sf.ehcache.hibernate.EhCacheProvider: can't find
referenced method 'CacheException(java.lang.Exception)' in class
org.hibernate.cache.CacheException
[proguard] Warning: net.sf.ehcache.hibernate.EhCache: can't find referenced
method 'CacheException(java.lang.Exception)' in class
org.hibernate.cache.CacheException
[proguard] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find
referenced method 'void
log(java.lang.String,org.apache.log4j.Level,java.lang.Object,java.lang.Throwable)'
in class org.apache.log4j.Category
[proguard] Warning: org.apache.commons.logging.impl.Log4JLogger: can't find
referenced method 'boolean isEnabledFor(org.apache.log4j.Level)' in class
org.apache.log4j.Category
[proguard] Warning: org.jdesktop.swingx.auth.LoginService$1: can't find
referenced method 'boolean isCancelled()' in class
org.jdesktop.swingx.auth.LoginService$1
[proguard] Warning: there were 33 unresolved references to superclasses or
interfaces.
[proguard] You may need to specify additional library jars (using
'-libraryjars'),
[proguard] or perhaps the '-dontskipnonpubliclibraryclasses'
option.
[proguard] Warning: there were 27 unresolved references to program class
members.
[proguard] Your input classes appear to be inconsistent.
[proguard] You may need to recompile them and try again.
[proguard] Alternatively, you may have to specify the options
[proguard] '-dontskipnonpubliclibraryclasses' and/or
[proguard] '-dontskipnonpubliclibraryclassmembers'.
[proguard] java.io.IOException: Please correct the above warnings first.
[proguard] at proguard.Initializer.execute(Initializer.java:277)
[proguard] at proguard.ProGuard.initialize(ProGuard.java:210)
[proguard] at proguard.ProGuard.execute(ProGuard.java:85)
[proguard] at proguard.ProGuard.main(ProGuard.java:499)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Obfuscation failed (result=1)
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 58 seconds
[INFO] Finished at: Mon Jun 30 16:42:54 ADT 2008
[INFO] Final Memory: 15M/29M
[INFO]
------------------------------------------------------------------------
As far as I know, all the project dependencies are handled automatically, so
I really shouldn't have to worry about the lib parameters, right?
Cheers,
Mikel
On Mon, Jun 30, 2008 at 15:20, Mikel Cármenes Cavia <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> I am trying to obfuscate my code by using Maven's ProGuard plugin.
>
> This is the section I added to my POM file to activate the plugin:
> ...
> <plugin>
> <groupId>com.pyx4me</groupId>
> <artifactId>proguard-maven-plugin</artifactId>
> <executions>
> <execution>
> <phase>package</phase>
> <goals><goal>proguard</goal></goals>
> </execution>
> </executions>
> <configuration>
> <obfuscate>true</obfuscate>
> <injar>${project.build.finalName}.jar</injar>
> <outjar>${project.build.finalName}-small.jar</outjar>
>
> <outputDirectory>${project.build.directory}</outputDirectory>
>
> <proguardInclude>${basedir}/proguard.conf</proguardInclude>
> <libs>
> <lib>${java.home}/lib/rt.jar</lib>
> </libs>
> <options>
> <option>-dontshrink</option>
> <option>-dontnote</option>
> </options>
> </configuration>
> </plugin>
> ...
> And this is what I get at the very end of my packaging:
>
> ...
> [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\mysql-connector-java\mysql-connector-java\5.0.3\mysql-connector-java-5.0.3.jar]
> [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\poi\poi\2.5.1-final-20040804\poi-2.5.1-final-20040804.jar]
> [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\servlet\servlet\4.1.31\servlet-4.1.31.jar]
> [proguard] Reading library jar [C:\Documents and
> Settings\Mikel\.m2\repository\swingx\swingx\0.9.3\swingx-0.9.3.jar]
> [proguard] Reading library jar [C:\Program
> Files\Java\jdk1.6.0_06\jre\lib\rt.jar]
> [proguard] Error: You have to specify '-keep' options for the shrinking
> step.
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Obfuscation failed (result=1)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 33 seconds
> [INFO] Finished at: Mon Jun 30 15:19:07 ADT 2008
> [INFO] Final Memory: 15M/29M
> [INFO]
> ------------------------------------------------------------------------
>
>
> Does anybody know what might be causing this? Thanks!
>
>