【发布时间】:2017-11-30 08:57:44
【问题描述】:
我已经使用 antrun-plugin maven 插件启用了混淆。我的allatori-config.xml 文件中没有keep-names:
<config>
<keep-names>
</keep-names>
<jars>
<jar in="${obf.jar}" out="${obf.jar}"/>
</jars>
<property name="log-file" value="target/allatori-log.xml"/>
</config>
这是我的 maven 插件配置的样子:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>package</phase>
<id>obfuscate2</id>
<configuration>
<target unless="${obfuscation.skip}">
<echo message="running allatori"/>
<property name="obf.jar" value="target/XYZ-${project.version}.jar"/>
<property name="runtime_classpath" refid="maven.runtime.classpath"/>
<taskdef name="allatori" classname="com.allatori.ant.ObfuscatorTask" classpath="${env.ALLATORI_LIB}/allatori.jar:${runtime_classpath}"/>
<allatori config="${basedir}/allatori-config.xml"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
我有 2 个模块(比如 A 和 B)要对其执行混淆处理。 现在模块 A 已成功混淆,但模块 B(依赖于模块 A)无法编译并显示“找不到符号”或“包 com.mycomp.xyz.schema 不存在”(这些包属于模块 A )。
如果稍后使用的模块首先被混淆,那么依赖模块无法获取依赖项或者我缺少什么?
【问题讨论】:
标签: maven obfuscation allatori