简体   繁体   中英

Multiple builds in maven

I build an application and it should be obfuscated.
The tricky thing is that I don't need a single artifact but rather some amount of artifacts that should be obfuscated differently.

Every one of those artifact should contain a different hardcoded constant.
Ie I have single code and in the end I should have lets say 10 jars that have the same codebase (but hardcoded constant should be different) with different obfuscations applied.

Is there a way to do this with maven?

Take a look at assembly plugin . This plugin allows to manipulate the way how you package the code. You can provide the configuration files, which define the packaging structure.

In case assembly plugin is too abstract to use, you can call any ant task through antrun plugin . This will allow to do any sort of magic with the source code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM