This is a noob question...

In my project I need to obfuscate my classes, and produce two jars:  one
with the unobfuscated code, one with the obfuscated code.

The obfuscation is Ant task attached to the process-classes phase, which
outputs the obfuscated classes in a folder called
${basedir}/target/obfuscated-classes/

My hope is that I can just use Maven's jar plugin to create the second jar
with the same resources/content/format as the first jar, except it's
outputDirectory (where it finds the classes to put in the jar) is
${basedir}/target/obfuscated-classes/

So I tried adding this to my pom:

<!-- Jar plugin, build a jar from the obfuscated classes -->

<plugin>

   <groupId>org.apache.maven.plugins</groupId>

   <artifactId>maven-jar-plugin</artifactId>

   <executions>

     <execution>

       <id>obfuscated-jar</id>

       <phase>package</phase>

       <goals>

         <goal>jar</goal>

       </goals>

       <configuration>

        <jarName>obfuscated-jar</jarName>                                
 
<outputDirectory>${basedir}/target/obfuscation/classes</outputDirectory>
       </configuration>

     </execution>

   </executions>

 </plugin>


But I get an error that outputDirectory is read only.  If I remove the
outputDirectory, I do get two jars, but their identical.  Is it possible to
do what I want to do?

Thank you ,
Dave

Reply via email to