mqsicreatebar command

Use the mqsicreatebar command to create deployable BAR files containing message flows and dictionaries.

Supported platforms

  • Windows
  • Linux®

Purpose

If you use a repository to store your message flows and dictionaries, you can write scripts that use the mqsicreatebar command and the repository's command-line tools to deploy your message flow applications.

Syntax

Read syntax diagramSkip visual syntax diagrammqsicreatebar -data WorkSpace  -b BarName -cleanBuild -version VersionString-Esql21 -p -------ProjectName -a ApplicationName-deployAsSource-compileOnly -l LibraryName -d ApplicationDomainName -o FilePath -skipWSErrorCheck  -trace  -v traceFilePath

Parameters

-data WorkSpace
(Required) The path of the workspace in which your projects are created.

The workspace location is also the default location for projects. Relative paths are interpreted as being relative to the directory from which the command was started.

-b BarName
(Optional) The name of the BAR (compressed file format) archive file where the result is stored. The BAR file is replaced if it already exists and the META-INF/broker.xml file is created.

This parameter is required if the -compileOnly parameter is not used.

-cleanBuild
(Optional) Refreshes the projects in the workspace and then invokes a clean build before new items are added to the BAR file.
Use the -cleanBuild parameter to refresh all the projects in the BAR file and run a clean build if amendments have been made to BAR file resources by using external tools.
-version VersionString
(Optional) Appends the _ (underscore) character and the value of VersionString to the names of the compiled versions of the message flows (.cmf) files added to the BAR file, before the file extension.
-Esql21
(Optional) Compile ESQL for integration nodes at Version 2.1 of the product.
-p ProjectName
(Optional) Projects containing files to include in the BAR file in a new workspace. A new workspace is a system folder without the .metadata folder.

The projects defined must already exist in the folder defined in the -data parameter, and must include all projects and their reference projects that a deployable resource, defined in the -o parameter, needs. If you set the -p parameter, you must also specify the -o parameter.

The -p parameter is optional with an existing workspace, but you should use -p, together with a new workspace, in a build environment. If you specify multiple projects, you must use the -p parameter once only, for example: -p projectname1 projectname2.

If a project that you specify is part of your workspace but is currently closed, the command opens and builds the project so that the files in the project can be included in the BAR file.

-a ApplicationName
(Optional) The name of an application to add to the BAR file.

You can add more than one application by using the following format: -a ApplicationName1 ApplicationName2 .... ApplicationName'n'

-deployAsSource
(Optional) Include this parameter to deploy applicable resource files without compiling them.

When the -deployAsSource parameter is used, any applicable resources are added to the BAR file as source files, and are not compiled into message flow .cmf files.

You cannot include both the compiled (.cmf) and source (.msgflow) versions of a message flow in a BAR file.

-compileOnly
(Optional) Include this parameter to compile message sets and Java™ code before you run the mqsipackagebar command. All relevant files in the workspace that is specified by the -data parameter are compiled. For more information about the mqsipackagebar command, see mqsipackagebar command.

If this parameter is specified with the -b parameter and one or more of the -a, -l, -d, or -o parameters, the command generates both the compiled resources and the specified BAR file.

-l LibraryName
(Optional) The name of a library to add to the BAR file.

You can add more than one library by using the following format: -l LibraryName1 LibraryName2 .... LibraryName'n'

-d ApplicationDomainName
(Optional) The name of a .NET application domain to add to the BAR file.

You can add more than one application domain by using the following format: -d ApplicationDomainName1 ApplicationDomainName2 .... ApplicationDomainName1'n'

-o FilePath
(Optional) The workspace relative path (including the project) of a deployable file to add to the BAR file; for example, a msgflow, subflow, or messageSet.mset file.

You can add more than one deployable file to this command by using the following format: -o FilePath1 FilePath2 .... FilePath'n'

-skipWSErrorCheck
(Optional) This parameter forces the BAR file compilation process to run, even if errors exist in the workspace.
-trace
(Optional) This parameter displays trace information for BAR file compilation.

The -trace parameter writes trace information into the system output stream, in the language specified by the system locale. When you add one or more applications or libraries to the BAR file, the specified application or library and all referenced projects are opened in the workspace. The trace function records this information so that you can see whether any referenced projects are missing.

-v traceFilePath
(Optional) This parameter specifies the file name of the output log to which trace information is sent.

If you specify the file name or relative path, the file is created in the default working directory. To use this parameter, you must also set the -trace parameter. You cannot specify the -v parameter on its own.

Authorization

On Linux, the user ID must have write access to the -data (workspace) and -b (BAR file location) directories.

Responses

This command returns the following responses:
  • BIP0956 Unable to start mqsicreatebar
  • BIP0957 Incorrect arguments supplied to mqsicreatebar
  • BIP0958 Nothing to do in mqsicreatebar
  • BIP0959 Incorrect arguments supplied to mqsicreatebar (Project name)
  • BIP0960 Incorrect arguments supplied to mqsicreatebar (Project directory)
  • BIP0961 Error opening workspace in mqsicreatebar (Project could not be created)
  • BIP0962 Error opening workspace in mqsicreatebar (Project could not be opened)
  • BIP0963 Error saving file in mqsicreatebar
  • BIP0964 Incorrect "-o" argument supplied to mqsicreatebar
  • BIP0965 Error compiling files in mqsicreatebar

Examples

You can run the mqsicreatebar command from a window opened anywhere in the file structure as long as the PATH environment variable specifies the correct path to the IBM Integration Toolkit directory.
  • On Windows, the default directory is C:\Program Files\IBM\IIB\10.0.0.n\tools.
  • On Linux, the default directory is install_dir/iib-10.0.0.n/tools.

The -b parameter specifies the name of the BAR file and an optional alternative path for BAR file generation. When a path is not specified as part of the -b parameter, the location in the file structure where the mqsicreatebar command runs specifies where the BAR file is created. For example, if you are currently in C:\> and run the mqsicreatebar command, the BAR file is created on C:\. However, if you run the mqsicreatebar with -b c:\myfiles\myflow.bar specified, the BAR file is created in the myfiles directory.

The following example creates a BAR file called myflow.bar in the directory where the command is issued. The Test.msgflow message flow from the TestFlowProject is added to the BAR file as a compiled message flow (.cmf) file.
mqsicreatebar -data C:\Workspace -b myflow.bar -p TestFlowProject -o TestFlowProject\TestFlow\Test.msgflow
The following example creates a BAR file called myflow.bar in the myfiles directory. The Test.msgflow message flow from the TestFlowProject is added to the BAR file, and any applicable resource files are added to the BAR file without being compiled.
mqsicreatebar -data C:\Workspace -b C:\myfiles\myflow.bar -p TestFlowProject -o TestFlowProject\TestFlow\Test.msgflow -deployAsSource
The following example creates a BAR file called mySet.bar. The messageSet.mset message set from the TestSetProject is added to the BAR file.
mqsicreatebar -data C:\Workspace -b mySet.bar -o TestSetProject\TestSet\messageSet.mset
The following example creates a BAR file called mySet.bar. The messageSet.mset message set from the TestSetProject and Test.msgflow message flow from the TestFlowProject are added to the BAR file. The message flow is added as a compiled message flow (.cmf) file.
mqsicreatebar -data C:\Workspace -b mySet.bar -o TestFlowProject\TestFlow\Test.msgflow
TestSetProject\TestSet\messageSet.mset 
The following example creates a BAR file called myflow.bar. The application Application1 is added to the BAR file and the trace function is activated.
mqsicreatebar -data C:\Workspace -b myflow.bar -a Application1 -trace