What Goes Where in Project Folders

Maven requires a strict organization of files within the project hierarchy. Organize files of different types into the folders reserved for them by the Maven project structure.

Note

Throughout this page, the term packagename refers to the project's GroupId + ArtifactId, and takes a form such as com.example.deptname.artifactid. This is established when you run the File>New>StreamBase Project wizard or the upgrade wizard, and applies to all fragment types and StreamBase Application projects.

A typical StreamBase project folder for an EventFlow fragment has the structure shown in the following image:

A LiveView fragment project adds src/main/liveview to this structure.

Project Folder Contents

src/main/eventflow/packagename

The following StreamBase file types belong in the packagename folder under src/main/eventflow:

  • EventFlow module files with .sbapp extension.

  • EventFlow module layout files with .sblayout extension.

  • StreamBase Interface files with .sbint extension.

  • StreamSQL module files with .ssql extension. (StreamSQL is a legacy, deprecated language alternative to EventFlow, but StreamSQL files are still allowed to help migrate legacy StreamBase applications.)

Files in this folder are automatically on Maven's module search path.

You can add subfolders or child folders to the packagename folder to organize your files into different packages. To create a new folder in a StreamBase Maven project:

  1. Select the packagename folder for your project under src/main/eventflow.

  2. Right-click and select New>Folder.

This creates a subfolder that is automatically in the Maven module resource path.

Note

The ep-maven-plugin now considers eventflow sources from src/test/eventflows. These are built and available for local maven module testing. They are not shipped in the eventflow fragment archive.

src/main/eventflow/lvinterfaces

This folder is found in LiveView projects only, and is created when you run StreamBase>Generate LiveView Interfaces from the context menu of a LiveView project folder. This folder contains StreamBase interface files with .sbint extension that are generated to define the schemas of LiveView tables.

src/main/liveview

This folder is found in LiveView fragment projects only. The following LiveView file type belongs in the src/main/liveview folder:

  • LiveView configuration files with .lvconf extension.

Configuration files in this folder are compiled into LiveView tables when you run the LiveView project.

The File>New>StreamBase Project wizard and upgrade wizard also create two subfolders:

  • lv-user-webapps, which is a container for customer-provided JavaScript code that enables customer-specific web interfaces for LiveView server. This subfolder is also the container for the lvweb.war file that adds Spotfire LiveView Web functionality to a LiveView project.

  • lv-web, which is a container for customer-provided LiveView Web extension code in lv-web/plugins and lv-web/themes.

If the legacy project upgrade wizard finds LiveView configuration files in subfolders of the legacy project, it creates the matching subfolder in src/main/liveview to contain those files.

src/main/configurations

Place all HOCON configuration files in src/main/configurations:

  • HOCON configuration files must use the extension .conf.

  • Use any basename for each HOCON file that reminds you of its contents.

  • The actual HOCON type for each file is specified in the type= line near the top of the file. This is why having several HOCON files in the same folder does not create conflicts.

  • Certain configuration files are generated for you by the New>StreamBase Project wizard or upgrade wizard, such as engine.conf or fragment.conf. These are generally templates that provide the structure of a configuration file without setting any parameters.

src/test/configurations

This folder contains HOCON configuration files that are to be considered when running unit tests for the current project.

src/main/java/packagename

If your project includes Java files that implement a StreamBase extension such as a custom function, custom operator, or custom adapter, place those files in the packagename folder under src/main/java.

You can organize your Java files into different packages using New>Package from the packagename folder's context menu.

src/main/resources

The following file types belong in the src/main/resources folder. Files in this folder are automatically on the Maven resource search path.

  • StreamBase Feed Simulation files with .sbfs extension.

  • Any CSV file used as input for a feed simulation, or used by any operator or adapter.

  • Image files used as custom icon overlays for Module Reference and Extension Point operators.

  • SQL scripts used to connect to a JDBC resource.

  • Decision Table files in both .sbdt and .xslx formats.

  • Decision Table Domain Model files with .json extension.

  • In general, any file that needs to be opened and used by any operator or adapter while your StreamBase application is running.

  • Adapter configuration XML files used by certain Spotfire Streaming adapters such as EMS and JMS adapters. These files are named adapter-configurations.xml that have <adapter-configurations> as the top-level element.

In general, files must be at the root of src/main/resources to be automatically in the Maven resource path. You can organize resource files into subfolders, and reference files with a relative path name such as subdir/myresourcefile. However, chooser dialogs in StreamBase Studio do not descend into subfolders to show their list of resource files.

src/test/java/packagename

This folder holds StreamBase JUnit test files that are run with the Maven Test goal. The New Project wizard generates the skeleton of such a file and places it in the packagename folder under src/main/java. Complete this file to get a working test. Add other test files as your project grows with more EventFlow modules.

src/test/resources

This folder holds any test-specific resource files needed by the StreamBase JUnit test files that you want to run. The New Project wizard generates a skeleton logback.xml file in this folder for you to customize as needed.

Resource file types for tests are any of the same file types described above for src/main/resources.

Supporting JAR Files

Certain adapters and operators require access to implementing JAR files, which are sometimes publicly available and sometimes proprietary. For example, the JDBC Table data construct requires information about the vendor-provided JAR file or files that implement JDBC access to that vendor's database system.

See Using External JAR Files for a discussion of the placement options for such JAR files.

Underlying Project File System

When you use an Eclipse-native feature such as File>Move, or when you use File>Export to archive a project, you may be surprised to see that the dialogs for these features show that the project folder in reality contains only src and target folders.

This is because the folder names described in the previous section are created with an Eclipse convenience link feature that is much like file system symbolic links. Using these linked folder names saves you from having to navigate down long folder paths such as src/main/eventflow/com/tibco/sb/sample/firstapp to locate files.