j2me:package

The j2me:package task is an wrapper for Jar task that handles JAD files correctly. It also allows for obfuscation and preverification of the generated file.

Mojo Attributes:

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

Required Parameters

Name Type Description
classifier String Classifier to add to the artifact generated. The artifact will be an attachment to project jar. Can be "none", See appendClassifier
j2meConfiguration String The midlets configuration Default value is CLDC-1.1.
j2meProfile String The midlets profile Default value is MIDP-2.0.
jadfile String The name of the JAD file to create or update. classifier would be appended.
jarfile String The name of the JAR file that accompanies the JAD file. classifier would be appended.
mavenProject MavenProject The Maven project reference where the plugin is currently being executed. The default value is populated from maven.
midletName String The midlets name Default value is ${project.name}.
midletVendor String The midlets vendor Default value is ${project.organization.name}.
midletVersion String The midlets version, -SNAPSHOT would be removed. Default value is ${project.version}.
outputDirectory File Directory containing the generated JAR.
testClassifier String Classifier to add to the test artifact generated. The artifact will be an attachment to project jar. See appendClassifier

Optional Parameters

Name Type Description
appendClassifier boolean Set to false to exclude the classifier from the Artifact final name. Default value is true. Default value is true.
archive MavenArchiveConfiguration The maven archive configuration to use.
assembly Assembly Bundle project dependency to resulting jar. Specifies list of artifact inclusions and exclusions. By default all provided and system scope dependency are excluded from final jar all other included.
attach boolean Specifies whether or not to attach the JAR and JAD artifacts to the project Default value is true.
copyJadAttributesToManifest boolean Copy custom properties from the JAD into the Manifest. Default value is true.
dependencies List Apply ProGuard classpathentry Filters to dependencies. When project compile dependency is used by ProGuard instead of WTK libs. See useWtkLibs
inFilter String Apply ProGuard classpathentry Filters to input jar. e.g. !**.gif,!**/awt/**,!**/tests/**'
jadAttributes Map The task also allows to specify an arbitrary number of attributes.
jourConfig String Reads configuration options from the given jour xml config file.
jourConfigTest String Reads configuration options from the given jour xml config file when processing "test" artifact.
libs List Additional -libraryjars e.g. ${java.home}/lib/rt.jar Project compile dependency used by ProGuard instead of WTK libs. See useWtkLibs
midlets MIDlet[] Arbitrary number of MIDlets using a nested element "MIDlet".
obfuscate boolean Specifies not to obfuscate the input class files. Default value is true.
preprocess boolean Specifies whether or not execute ClassPreprocessor on created JAR. Default value is false.
proguard boolean Specifies whether or not execute ProGuard on created JAR. Default value is true.
proguardInclude File Recursively reads ProGuard configuration options from the given file filename Default value is ${basedir}/proguard.conf.
proguardOptions ProguardOptions ProGuard configuration options
proguardPreverify boolean Use ProGuard preverification instead of WTK. (ProGuard option -microedition) Default value is false.
proguardTestInclude File Recursively reads ProGuard configuration options from the given file filename when processing test pakage. Default value is ${basedir}/proguard-test.conf.
proguardTestOptions ProguardOptions Additional ProGuard configuration options when processing test package.
projectHelper MavenProjectHelper No description.
test boolean Specifies whether or not create test JAR and JAD artifacts Default value is false.
testAttach boolean Specifies whether or not to attach the JAR and JAD test artifacts to the project Default value is false.
useWtkLibs boolean Use WTK libraries or project dependency provided artifacts. See libs Default value is true.
wtkHome String The path to the j2me sdk to use for preverifying. e.g. ${env.WTK_HOME}

Parameter Details

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

archive The maven archive configuration to use.
  • Type: org.apache.maven.archiver.MavenArchiveConfiguration
  • Required: No

assembly Bundle project dependency to resulting jar. Specifies list of artifact inclusions and exclusions. By default all provided and system scope dependency are excluded from final jar all other included.
  • Type: com.pyx4me.maven.j2me.Assembly
  • Required: No

attach Specifies whether or not to attach the JAR and JAD artifacts to the project
  • Type: boolean
  • Required: No
  • Expression: ${j2me.attach}
  • Default: true

classifier Classifier to add to the artifact generated. The artifact will be an attachment to project jar. Can be "none", See appendClassifier
  • Type: java.lang.String
  • Required: Yes
  • Expression: me

copyJadAttributesToManifest Copy custom properties from the JAD into the Manifest.
  • Type: boolean
  • Required: No
  • Default: true

dependencies Apply ProGuard classpathentry Filters to dependencies. When project compile dependency is used by ProGuard instead of WTK libs. See useWtkLibs
  • Type: java.util.List
  • Required: No

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

j2meConfiguration The midlets configuration
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${j2me.midlet.configuration}
  • Default: CLDC-1.1

j2meProfile The midlets profile
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${j2me.midlet.profile}
  • Default: MIDP-2.0

jadAttributes The task also allows to specify an arbitrary number of attributes.
  • Type: java.util.Map
  • Required: No

jadfile The name of the JAD file to create or update. classifier would be appended.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${project.build.finalName}

jarfile The name of the JAR file that accompanies the JAD file. classifier would be appended.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${project.build.finalName}

jourConfig Reads configuration options from the given jour xml config file.
  • Type: java.lang.String
  • Required: No

jourConfigTest Reads configuration options from the given jour xml config file when processing "test" artifact.
  • Type: java.lang.String
  • Required: No

libs Additional -libraryjars e.g. ${java.home}/lib/rt.jar Project compile dependency used by ProGuard instead of WTK libs. See useWtkLibs
  • Type: java.util.List
  • Required: No

mavenProject The Maven project reference where the plugin is currently being executed. The default value is populated from maven.
  • Type: org.apache.maven.project.MavenProject
  • Required: Yes
  • Expression: ${project}

midletName The midlets name
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${j2me.midlet.name}
  • Default: ${project.name}

midletVendor The midlets vendor
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${j2me.midlet.vendor}
  • Default: ${project.organization.name}

midletVersion The midlets version, -SNAPSHOT would be removed.
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${j2me.midlet.version}
  • Default: ${project.version}

midlets Arbitrary number of MIDlets using a nested element "MIDlet".
  • Type: com.pyx4me.maven.j2me.MIDlet[]
  • Required: No

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

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

preprocess Specifies whether or not execute ClassPreprocessor on created JAR.
  • Type: boolean
  • Required: No
  • Expression: ${j2me.preprocess}
  • Default: false

proguard Specifies whether or not execute ProGuard on created JAR.
  • Type: boolean
  • Required: No
  • Expression: ${j2me.obfuscate}
  • Default: true

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

proguardOptions ProGuard configuration options
  • Type: com.pyx4me.maven.j2me.ProguardOptions
  • Required: No

proguardPreverify Use ProGuard preverification instead of WTK. (ProGuard option -microedition)
  • Type: boolean
  • Required: No
  • Default: false

proguardTestInclude Recursively reads ProGuard configuration options from the given file filename when processing test pakage.
  • Type: java.io.File
  • Required: No
  • Default: ${basedir}/proguard-test.conf

proguardTestOptions Additional ProGuard configuration options when processing test package.
  • Type: com.pyx4me.maven.j2me.ProguardOptions
  • Required: No

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

test Specifies whether or not create test JAR and JAD artifacts
  • Type: boolean
  • Required: No
  • Default: false

testAttach Specifies whether or not to attach the JAR and JAD test artifacts to the project
  • Type: boolean
  • Required: No
  • Default: false

testClassifier Classifier to add to the test artifact generated. The artifact will be an attachment to project jar. See appendClassifier
  • Type: java.lang.String
  • Required: Yes
  • Expression: test

useWtkLibs Use WTK libraries or project dependency provided artifacts. See libs
  • Type: boolean
  • Required: No
  • Default: true

wtkHome The path to the j2me sdk to use for preverifying. e.g. ${env.WTK_HOME}
  • Type: java.lang.String
  • Required: No