简体   繁体   English

在Maven中进行多次构建

[英]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. 即我只有一个代码,最后我应该说10个具有相同代码库(但硬编码常量应该不同)且应用了不同混淆的罐子。

Is there a way to do this with maven? 有办法用Maven做到这一点吗?

Take a look at assembly plugin . 看一下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 . 如果汇编插件太抽象而无法使用,则可以通过antrun plugin调用任何ant任务。 This will allow to do any sort of magic with the source code. 这将允许您对源代码进行各种魔术。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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