Maven 中的多个构建 [英] Multiple builds in maven

查看:43
本文介绍了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.

这些工件中的每一个都应该包含一个不同的硬编码常量.
IE.我只有一个代码,最后我应该说 10 个具有相同代码库(但硬编码常量应该不同)并应用了不同混淆的 jar.

Every one of those artifact should contain a different hardcoded constant.
I.e. 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.

maven 有没有办法做到这一点?

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.

如果汇编插件太抽象无法使用,您可以通过调用任何ant任务antrun 插件.这将允许对源代码做任何类型的魔术.

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.

这篇关于Maven 中的多个构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆