Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot links in documentation don't work #166

Open
peterkronenberg opened this issue Oct 22, 2021 · 5 comments
Open

Hot links in documentation don't work #166

peterkronenberg opened this issue Oct 22, 2021 · 5 comments

Comments

@peterkronenberg
Copy link

Hi, I'm trying to get this plugin working, but having some difficulty. The hotlinks at https://wvengen.github.io/proguard-maven-plugin don't seem to work. And I can't find documentation on the various configuration elements and options

I posted an issue here, https://stackoverflow.com/questions/69667717/obfuscate-java-jar-with-proguard-plug-in, but haven't gotten a response yet.

@lasselindqvist
Copy link
Collaborator

Hi. The docs do contain some outdated links.
The Proguard documentation itself is located in https://www.guardsquare.com/manual/home

The Maven plugin parameter documentation is located in https://wvengen.github.io/proguard-maven-plugin/proguard-mojo.html but most of the parameters are not needed for basic obfuscation.
[proguard] Warning: class [BOOT-INF/classes/com/torchai/service/textextractor/aspect/ControllerLayerAspect.class] unexpectedly contains class [com.torchai.service.textextractor.aspect.ControllerLayerAspect]
is a false positive and only a warning.
See https://github.com/Guardsquare/proguard-core/blob/d171cfa11c79e77914cc113dbfb235ff95d92a82/src/main/java/proguard/io/ClassReader.java#L107
You could report this to https://github.com/Guardsquare/proguard-core/issues
The code should probay strip away the "BOOT-INF/classes/" in the name comparison.

Note: duplicate definition of library class
happens because you have the same dependency twice in your Maven dependencies, probably with two different versions. This is something you will want to take a look at. Check also https://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html to make preventing this easier.
For you the javax.annotation.ManagedBean probably comes once from the Java EE server libraries and once through some other dependency. See how many other dependencies depend on the Javax Annotation API: https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api/usages

@peterkronenberg
Copy link
Author

Thanks. I didn't think I should have to specify many options, but I couldn't get it working

This is the config I'm using

<plugin>                                                              
    <groupId>com.github.wvengen</groupId>                             
    <artifactId>proguard-maven-plugin</artifactId>                    
    <version>2.5.1</version>                                          
    <dependencies>                                                    
        <dependency>                                                  
            <groupId>com.guardsquare</groupId>                        
            <artifactId>proguard-base</artifactId>                    
            <version>7.1.1</version>                                  
            <scope>runtime</scope>                                    
        </dependency>                                                 
        <dependency>                                                  
            <groupId>com.guardsquare</groupId>                        
            <artifactId>proguard-core</artifactId>                    
            <version>7.1.1</version>                                  
            <scope>runtime</scope>                                    
        </dependency>                                                 
    </dependencies>                                                   
    <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> 
        <proguardVersion>7.1.1</proguardVersion>                      
        <options>                                                     
                                                                      
        </options>                                                    
        <libs>                                                        
            <lib>${java.home}/lib/rt.jar</lib>                        
            <lib>${java.home}/lib/jce.jar</lib>                       
        </libs>                                                       
    </configuration>                                                  
</plugin>                    

@peterkronenberg
Copy link
Author

peterkronenberg commented Oct 22, 2021

Wow, I just ran the plugin at https://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html and I wouldn't even know where to begin. But is this a fatal error? Is this what's casing Proguard to fail?

Even though they are Warnings, I get an error that says Error: Please correct the above warnings

@peterkronenberg
Copy link
Author

I got a little further by specifying -ignorewarnings, which I'm still not sure is a good thing to do, but now I'm getting lots of messages like this:
image

image

It tells me to use the -keep option on elements with -printseeds, which I don't understand at all. And then it also seens there were 3 access to class members by means of reflection, but I'm not sure how to tell what they are.

@lasselindqvist
Copy link
Collaborator

The dependencyConverge problems are not usually errors, but it tells you that the dependency version you get to the final product might be somewhat random, so those are things you want to check out.

The "-keep/-printseeds" error is the one failing your build. So you need to check your options. The ones you showed were empty, but I assume in reality you have some options there. Also the problems there do relate really to Proguard, not this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants