codepro.exportToJarFile

(replaced in Eclipse 3.x / Ant 1.6.2 by Jar)

(old task name "ExportToJarFile")

Exports project resources to a specified jar file.  Each line in the <Resources> section defines a project resource or group of resources to be exported, where all paths are relative to the workspace root.  If the resource specified is a folder, then recursively all files and folders in that folder will included in the export.   Valid attributes include:

  • manifestVersion (optional - default "1.0")
  • exportClassFiles (optional - default true)
  • exportJavaFiles (optional - default false)
  • jarLocation (required)
  • overwrite (optional - default false)
  • compress (optional - default true)
  • descriptionLocation (optional)
  • generateManifest (optional - default true)
  • manifestLocation (optional)
  • sealJar (optional - default false)
  • mainClass (optional)
        specify full eclipse resource path relative to the eclipse workspace root
        (e.g. mainClass="/WSAssistTest/src/com/instantiations/jrf/demo/MainClass.java")
  • downloadExtensionsPath (optional)
  • exportErrors (optional - default true)
  • exportWarnings (optional - default true)

Valid attributes not exposed in the UI:

  • logErrors (optional - default true)
  • logWarnings (optional - default true)
  • haltOnError (optional - default true)
  • haltOnWarning (optional - default true)
  • excludes (option - default "")

    The excludes attribute is a comma delimited list of files and directories that are to be excluded.  If the name of a directory is specified, then all files and sub-directories in that directory are omitted from the resulting jar file.  The "*" wildcard can be used as the first character or the last character of a name to represent zero or more characters.

Example:

<codepro.exportToJarFile jarLocation="G:/export-out/export.jar">
	<Resources>
		/CodeProStudioDemo
	</Resources>
</codepro.exportToJarFile>

In this example, the CodeProStudioDemo project's classfiles are exported to the specified jar file.

Note: to avoid potential OperationCanceledException errors during execution, make sure to turn on the overwrite option. If that option is turned off and the jar file already exists, you will get an exception.