proguard:proguard
Full name:
com.github.wvengen:proguard-maven-plugin:2.7.1-SNAPSHOT:proguard
Description:
Runs ProGuard as part of the build.
Attributes:
- Requires a Maven project to be executed.
- Requires dependency resolution of artifacts in scope:
compile
. - The goal is thread-safe and supports parallel builds.
- Binds by default to the lifecycle phase:
package
.
Required Parameters
Name | Type | Since | Description |
---|---|---|---|
<injar> |
String |
- |
Specifies the input jar name (or wars, ears, zips) of the
application to be processed.
You may specify a classes directory e.g. 'classes'. This way the plugin will process the classes instead of the jar. You would need to bind the execution to phase 'compile' or 'process-classes' in this case. |
<outputDirectory> |
File |
- |
Directory containing the input and generated JAR. User Property: project.build.directory |
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<addManifest> |
boolean |
- |
Whether to include META-INF/MANIFEST.MF fileDefault: false |
<addMavenDescriptor> |
boolean |
- |
Whether to include META-INF/maven/** Maven descriptor.Default: false |
<appendClassifier> |
boolean |
- |
Whether to append the attachArtifactClassifier to the
artifact final name.Default: true |
<applyMappingFile> |
File |
- |
Sets the name of the ProGuard -applymapping file. |
<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 to attach the created artifact to the project. Default: false |
<attachArtifactClassifier> |
String |
- |
Specifies attach artifact Classifier, ignored if
attach is 'false'.Default: small |
<attachArtifactType> |
String |
- |
Specifies attach artifact type. Default: jar |
<attachMap> |
boolean |
- |
Determines if attach also attaches the
mappingFileName file.Default: false |
<attachSeed> |
boolean |
- |
Determines if attach also attaches the
seedFileName file.Default: false |
<bindToMavenLogging> |
boolean |
- |
Bind ProGuard output to Maven plugin logging. Default: false |
<exclusions> |
List |
- |
List of dependency exclusions |
<generateTemporaryConfigurationFile> |
boolean |
- |
Use this parameter if your command line arguments become too long
and execution fails.
If this parameter is 'true', the configuration is passed to the ProGuard process through a file, instead of through command line arguments. This bypasses the operating system restrictions on the length of the command line arguments. Default: false |
<inFilter> |
String |
- |
Apply ProGuard classpathentry filters to input jar. e.g.
!**.gif,!**/tests/** |
<inLibsFilter> |
String |
- |
Apply ProGuard classpathentry filters to all input lib jars. e.g.
!META-INF/**,!META-INF/versions/9/**.class |
<includeDependency> |
boolean |
- |
Specifies that project compile dependencies be added as
-libraryjars to ProGuard arguments. Dependency itself
is not included in resulting jar unless you set
includeDependencyInjar to 'true'.Default: true |
<includeDependencyInjar> |
boolean |
- |
Specifies that project compile dependencies should be added as
-injars .Default: false |
<incremental> |
boolean |
- |
Specifies whether to enable incremental
obfuscation Default: false |
<injarNotExistsSkip> |
boolean |
- |
Set this to 'true' to bypass ProGuard processing when injar does
not exists. Default: false |
<libs> |
List |
- |
Additional -libraryjars e.g.
${java.home}/lib/rt.jar . Project compile dependency
are added automatically, see exclusions . |
<mappingFileName> |
String |
- |
Sets the name of the ProGuard mapping file. Default: proguard_map.txt |
<maxMemory> |
String |
- |
The max memory the forked Java process should use, e.g. 256m |
<obfuscate> |
boolean |
- |
Specifies whether to obfuscate the input class files. Default: true |
<options> |
String[] |
- |
ProGuard configuration options |
<outFilter> |
String |
- |
Apply ProGuard classpathentry filters to output jar. e.g.
!**.gif,!**/tests/** |
<outjar> |
String |
- |
Specifies the names of the output jars. If not set, the input jar
is overwritten.
If |
<proguardInclude> |
File |
- |
Recursively reads configuration options from the given file. Default: ${basedir}/proguard.conf |
<proguardJar> |
File |
- |
The ProGuard jar to use. Useful for using beta versions of ProGuard that aren't yet on Maven Central. |
<proguardMainClass> |
String |
- |
ProGuard main class name. Default: proguard.ProGuard |
<proguardVersion> |
String |
- |
Select specific ProGuard version from plugin dependencies. |
<putLibraryJarsInTempDir> |
boolean |
- |
Specifies to copy all the -libraryjars dependencies
into a temporary directory and pass that directory as the only
-libraryjars argument to ProGuard.Default: false |
<seedFileName> |
String |
- |
Sets the name of the ProGuard seed file. Default: proguard_seed.txt |
<silent> |
boolean |
- |
If the plugin should be silent. Default: false |
<skip> |
boolean |
- |
Set this to 'true' to bypass ProGuard processing entirely. User Property: proguard.skip |
<useDexGuard> |
boolean |
- |
To run DexGuard instead of ProGuard, set this to 'true'. Default: false |
Parameter Details
<addManifest>
META-INF/MANIFEST.MF
file- Type:
boolean
- Required:
No
- Default:
false
<addMavenDescriptor>
META-INF/maven/**
Maven descriptor.- Type:
boolean
- Required:
No
- Default:
false
<appendClassifier>
attachArtifactClassifier
to the
artifact final name.- Type:
boolean
- Required:
No
- Default:
true
<applyMappingFile>
-applymapping
file.- Type:
java.io.File
- Required:
No
<archive>
assembly
is used.- Type:
org.apache.maven.archiver.MavenArchiveConfiguration
- Required:
No
<assembly>
- Type:
com.github.wvengen.maven.proguard.Assembly
- Required:
No
<attach>
- Type:
boolean
- Required:
No
- Default:
false
<attachArtifactClassifier>
attach
is 'false'.- Type:
java.lang.String
- Required:
No
- Default:
small
<attachArtifactType>
- Type:
java.lang.String
- Required:
No
- Default:
jar
<attachMap>
attach
also attaches the
mappingFileName
file.- Type:
boolean
- Required:
No
- Default:
false
<attachSeed>
attach
also attaches the
seedFileName
file.- Type:
boolean
- Required:
No
- Default:
false
<bindToMavenLogging>
- Type:
boolean
- Required:
No
- Default:
false
<exclusions>
- Type:
java.util.List
- Required:
No
<generateTemporaryConfigurationFile>
If this parameter is 'true', the configuration is passed to the ProGuard process through a file, instead of through command line arguments. This bypasses the operating system restrictions on the length of the command line arguments.
- Type:
boolean
- Required:
No
- Default:
false
<inFilter>
!**.gif,!**/tests/**
- Type:
java.lang.String
- Required:
No
<inLibsFilter>
!META-INF/**,!META-INF/versions/9/**.class
- Type:
java.lang.String
- Required:
No
<includeDependency>
-libraryjars
to ProGuard arguments. Dependency itself
is not included in resulting jar unless you set
includeDependencyInjar
to 'true'.- Type:
boolean
- Required:
No
- Default:
true
<includeDependencyInjar>
-injars
.- Type:
boolean
- Required:
No
- Default:
false
<incremental>
- Type:
boolean
- Required:
No
- Default:
false
<injar>
You may specify a classes directory e.g. 'classes'. This way the plugin will process the classes instead of the jar. You would need to bind the execution to phase 'compile' or 'process-classes' in this case.
- Type:
java.lang.String
- Required:
Yes
- Expression:
${project.build.finalName}.jar
<injarNotExistsSkip>
- Type:
boolean
- Required:
No
- Default:
false
<libs>
-libraryjars
e.g.
${java.home}/lib/rt.jar
. Project compile dependency
are added automatically, see exclusions
.- Type:
java.util.List
- Required:
No
<mappingFileName>
- Type:
java.lang.String
- Required:
No
- Default:
proguard_map.txt
<maxMemory>
- Type:
java.lang.String
- Required:
No
<obfuscate>
- Type:
boolean
- Required:
No
- Default:
true
<options>
- Type:
java.lang.String[]
- Required:
No
<outFilter>
!**.gif,!**/tests/**
- Type:
java.lang.String
- Required:
No
<outjar>
If attach
is 'true' the value is ignored and the
name is constructed based on classifier.
- Type:
java.lang.String
- Required:
No
<outputDirectory>
- Type:
java.io.File
- Required:
Yes
- User Property:
project.build.directory
<proguardInclude>
- Type:
java.io.File
- Required:
No
- Default:
${basedir}/proguard.conf
<proguardJar>
- Type:
java.io.File
- Required:
No
<proguardMainClass>
- Type:
java.lang.String
- Required:
No
- Default:
proguard.ProGuard
<proguardVersion>
- Type:
java.lang.String
- Required:
No
<putLibraryJarsInTempDir>
-libraryjars
dependencies
into a temporary directory and pass that directory as the only
-libraryjars
argument to ProGuard.- Type:
boolean
- Required:
No
- Default:
false
<seedFileName>
- Type:
java.lang.String
- Required:
No
- Default:
proguard_seed.txt
<silent>
- Type:
boolean
- Required:
No
- Default:
false
<skip>
- Type:
boolean
- Required:
No
- User Property:
proguard.skip
<useDexGuard>
- Type:
boolean
- Required:
No
- Default:
false