wvengen / proguard-maven-plugin

ProGuard Maven plugin that supports modularised ProGuard packages
http://wvengen.github.io/proguard-maven-plugin/
Apache License 2.0
606 stars 151 forks source link

Applied mapping file contains invalid entries #335

Open Denqu opened 4 months ago

Denqu commented 4 months ago

Hello everyone,

first of all, thank you for the proguard maven plugin :)

Unfortunately we have noticed a issue, when using the applyMappingFile option.

Here is our setup:

While running the maven build, all modules executes the proguard-maven-plugin. The plugin executions write into the applied mapping file. Rarely thewrite process of the proguard-maven-plugin results into a "broken" mapping file. Entries like com.my.company.class.LoremIpsumClass -> com.mycom.my.company.class.AnotherLoremIpsumClass -> com.my.company.class.AnotherLoremIpsumClass appears in the mapping file.

My assumption is, that multiple plugin executions writes at the same time into the file. So maybe the write process needs to be synchronized.

lasselindqvist commented 4 months ago

The short answer is to not use the same global file from multiple modules.

How do you expect the file to behave even if the writes were synced?

Denqu commented 4 months ago

Our assumption was that, the incremental obfuscation requires a single mapping file. So all following maven modules and maven projects can respect the obfuscation done in previous modules/projects by reading the global mapping file.

lasselindqvist commented 4 months ago

Makes sense. Seems like a syncronizing lock would be neede for your use case. I will happily merge any pull request implementing it.

(https://www.guardsquare.com/manual/configuration/examples#incremental)