Table Of Contents

Previous topic

Running unit tests

Next topic

Package format 1 (legacy)

This Page

Migrating from format 1 to format 2

The differences between format 1 and format 2 only affect the package.xml with its dependencies. REP-0140 defines these differences and provides their rationale.


The <package> tag determines which format to use, change it like this:

<package format="2">


This is a new tag, intended to reduce unnecessary repetition. If your format 1 package contained:


It should be replaced with:


In format 2, that is equivalent to:



This tag is no longer allowed. Wherever found, it must be replaced:


In format 2, that is equivalent to these two new tags:


If the dependency is only used at run-time, only the <exec_depend> is needed. If it is only exported to satisfy other packages’ build dependencies, use <build_export_depend>. If both are needed, this may be a better choice:



In format 2, this tag can satisfy build dependencies, not just those needed for executing your tests. Unlike format 1, <test_depend> may now refer to a package also declared as some other type of dependency.

Some test-only dependencies that formerly required a <build_depend>, should now be expressed using <test_depend>. For example:




In your CMakeLists.txt make sure your test dependencies are only referenced within the conditional test block:

  find_package(rostest REQUIRED)


This tag defines dependencies needed for building your documentation:


Those examples are automatically provided by the ROS build farm, but there is no harm in declaring which you actually use. They do not create binary package dependencies, unless they were also declared using some other dependency tag.