proguard:proguard

The Obfuscate task provides a stand-alone obfuscation task

Mojo Attributes:

  • Requires a Maven 2.0 project to execute.
  • Requires dependency resolution of artifacts in scope: compile
  • Automatically executes within the lifecycle phase: package

Required Parameters

Name Type Description
injar String Specifies the input jar name (or wars, ears, zips) of the application to be processed.
outputDirectory File Directory containing the input and generated JAR.

Optional Parameters

Name Type Description
addMavenDescriptor boolean Set to true to include META-INF/maven/** maven descriptord Default value is false.
appendClassifier boolean Set to false to exclude the attachArtifactClassifier from the Artifact final name. Default value is true. Default value is true.
archive MavenArchiveConfiguration The maven archive configuration to use. only if assembly is used.
assembly Assembly Bundle project dependency to resulting jar. Specifies list of artifact inclusions
attach boolean Specifies whether or not to attach the created artifact to the project Default value is false.
attachArtifactClassifier String Specifies attach artifact Classifier, Ignored if attach=false Default value is small.
attachArtifactType String Specifies attach artifact type Default value is jar.
exclusions List List of dependency exclusions
inFilter String Apply ProGuard classpathentry Filters to input jar. e.g. !**.gif,!**/tests/**'
includeDependency boolean Specifies that project compile dependencies be added as -libraryjars to proguard arguments. Dependency itself is not included in resulting jar Default value is true.
libs List Additional -libraryjars e.g. ${java.home}/lib/rt.jar Project compile dependency are added automaticaly. See exclusions
maxMemory String The max memory the forked java process should use, e.g. 256m
obfuscate boolean Specifies not to obfuscate the input class files. Default value is true.
options String[] ProGuard configuration options
outjar String Specifies the names of the output jars. If attach=true the value ignored and name constructed base on classifier If empty input jar would be overdriven.
proguardInclude File Recursively reads configuration options from the given file filename Default value is ${basedir}/proguard.conf.
projectHelper MavenProjectHelper No description.

Parameter Details

addMavenDescriptor Set to true to include META-INF/maven/** maven descriptord
  • Type: boolean
  • Required: No
  • Default: false

appendClassifier Set to false to exclude the attachArtifactClassifier from the Artifact final name. Default value is true.
  • Type: boolean
  • Required: No
  • Default: true

archive The maven archive configuration to use. only if assembly is used.
  • Type: org.apache.maven.archiver.MavenArchiveConfiguration
  • Required: No

assembly Bundle project dependency to resulting jar. Specifies list of artifact inclusions
  • Type: com.pyx4me.maven.proguard.Assembly
  • Required: No

attach Specifies whether or not to attach the created artifact to the project
  • Type: boolean
  • Required: No
  • Default: false

attachArtifactClassifier Specifies attach artifact Classifier, Ignored if attach=false
  • Type: java.lang.String
  • Required: No
  • Default: small

attachArtifactType Specifies attach artifact type
  • Type: java.lang.String
  • Required: No
  • Default: jar

exclusions List of dependency exclusions
  • Type: java.util.List
  • Required: No

inFilter Apply ProGuard classpathentry Filters to input jar. e.g. !**.gif,!**/tests/**'
  • Type: java.lang.String
  • Required: No

includeDependency Specifies that project compile dependencies be added as -libraryjars to proguard arguments. Dependency itself is not included in resulting jar
  • Type: boolean
  • Required: No
  • Default: true

injar Specifies the input jar name (or wars, ears, zips) of the application to be processed.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${project.build.finalName}.jar

libs Additional -libraryjars e.g. ${java.home}/lib/rt.jar Project compile dependency are added automaticaly. See exclusions
  • Type: java.util.List
  • Required: No

maxMemory The max memory the forked java process should use, e.g. 256m
  • Type: java.lang.String
  • Required: No

obfuscate Specifies not to obfuscate the input class files.
  • Type: boolean
  • Required: No
  • Default: true

options ProGuard configuration options
  • Type: java.lang.String[]
  • Required: No

outjar Specifies the names of the output jars. If attach=true the value ignored and name constructed base on classifier If empty input jar would be overdriven.
  • Type: java.lang.String
  • Required: No

outputDirectory Directory containing the input and generated JAR.
  • Type: java.io.File
  • Required: Yes
  • Expression: ${project.build.directory}

proguardInclude Recursively reads configuration options from the given file filename
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/proguard.conf

projectHelper No Description.
  • Type: org.apache.maven.project.MavenProjectHelper
  • Required: No