How to rename the package in a StreamBase 10 project

How to rename the package in a StreamBase 10 project

book

Article ID: KB0081199

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10

Description

I have a project created with default package "com.example" and now I need to rename to package to "com.mycompany.thisproject".
What are the steps?

Issue/Introduction

Using Search and Replace.

Resolution

As of SB 10.3, renaming a package is best done with steps:

1. Create a new project with the correct group id, artifact id, and package names.

2. Copy all artifacts from the old project to the new project. 

3. Use Search and Replace to change references to artifacts still referenced using the old package name.

In the copied files the old name may appear as the fully-qualified package and also as its simple name. To correct this:
a) Search for and Replace the old package name with the new package name.
b) Search for and Replace the old simple name with the new simple name.

To use Search and Replace:

1. Open an application file from the project you are searching and make it the active EventFlow editor.

2. Use menu: Search > Search...

The Search dialog with Enclosing Project scope selected

3. Set Scope to "Enclosing projects".

4. Click Replace. This performs the search and if the search term is found, then the Replace dialog will become available.

The Replace dialog with OK and Preview buttons

5. Provide the replacement text and click [OK], or [Preview...] to include and exclude specific replacements.

Since this process is not governed by a context-aware refactorization, there may be errors if the search scope was too broad or narrow. Review new problem reports in the Problems view for additional changes required after this step. For some files you may wish to revert from Local History using right-click command " Replace With > Previous from local history" in the Project Explorer.