Follow

Packaging Java Applications for Profiling

Overview:

PaaSLane  Profiling is able to reverse engineer source code from non-obfuscated class files, but is more effective when source code is provided.  In order to provide source code, you must package your source code in your JAR or WAR file(s). Any included source code should be in a folder named "src" in the root of the JAR or WAR file.

 

Maven Example:

If you use Maven to build as your build tool, you can use the following as an example for including the source files when profiling. Simply add the profile below to the war or jar pom file. Then, when you want to include source files, adding -Psource to your maven directive will include these source files.

 

  <profile>
   <id>source</id>
   <build>
       <resources>
              <resource>
                    <filtering>false</filtering>
                    <directory>src/main/java</directory>
                    <targetPath>${project.build.directory}/classes/src</targetPath>
              </resource>
       </resources>
       <plugins>
              <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                         <webResources  combine.children="append">
                               <resource>
                                   <directory>src/main/java</directory>
                                   <filtering>false</filtering>
                                   <targetPath>src</targetPath>
                               </resource>
                         </webResources>
                   </configuration>
              </plugin>
         </plugins>
    </build>
</profile>

Comments

Powered by Zendesk