Create Different Profiles in Maven pom.xml
For my Java project’s obfuscation, I used Zelix as I described in this post.
Later on, while the project continues to evolve, to be able to understand exceptions, logs, etc. better in test environment, I wanted to be able to obfuscate or not based on a config in my pom.xml.
Following this link, I was able to accomplish it by “profiles”:
You can now run “mvn package” command with your profile parameter:
mvn clean package -DskipTests -Dmaven.repo.local=/Users/senoritadev/dev/repository -P obfuscated
“activeByDefault” in pom.xml is used for default configuration where you do not send a profile parameter in your command.
Happy Coding!