skipcheck

Java · Spring Boot

TM1 Spring Boot starter

The TM1 client, as Spring Boot beans

Add the starter, set a few tm1.* properties, and inject a ready Tm1Client. Session pooling, per-user impersonation and metrics come with it, and the companion module wires a TM1 container into your Spring Boot tests.

DocsSource on GitHub

v0.1.1The latest release. The install steps below use it, in every language.

  1. Have a TM1 server to talk to. To run one on your own computer, follow Run Planning Analytics on your own computer. You need your own licensed copy of TM1 Server.
  2. Add the starter to a Spring Boot 4 application.

    Needs Java 17 or later.

    Gradle (Kotlin)

    implementation("io.skipcheck:tm1-spring-boot-starter:0.1.1")

    Maven

    <dependency>
      <groupId>io.skipcheck</groupId>
      <artifactId>tm1-spring-boot-starter</artifactId>
      <version>0.1.1</version>
    </dependency>
  3. Tell it where TM1 is. The starter connects with the tm1 settings in application.yml; these are the defaults of a server set up with the link above:

    application.yml
    # src/main/resources/application.yml
    tm1:
      # Where TM1 is: the server's address, as for tm1-server on this computer
      address: http://localhost:8010
      # Who to log in as: tm1-server's default admin, with no password
      user: admin
      password: ""
      # With Cognos (CAM) security, also name the CAM namespace:
      # namespace: LDAP

    For a server elsewhere, change the address. Keep a real password out of the file, for example with password: ${TM1_PASSWORD} and an environment variable. Tm1Properties lists every property.

  4. Say hello. The starter builds a Tm1Client from those settings; ask for it, and use it. This prints the server's version and lists its cubes when the application starts:

    Java
    import org.springframework.boot.ApplicationRunner;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.context.annotation.Bean;
    
    import io.skipcheck.tm1.client.Tm1Client;
    import io.skipcheck.tm1.client.model.Cube;
    import io.skipcheck.tm1.client.odata.ODataQuery;
    
    @SpringBootApplication
    public class HelloTm1Application {
    
        public static void main(String[] args) {
            SpringApplication.run(HelloTm1Application.class, args);
        }
    
        // The starter built the client from the tm1 settings: just ask for it
        @Bean
        ApplicationRunner hello(Tm1Client tm1) {
            return args -> tm1.session()
                .version()
                .doOnNext(version -> System.out.println("Hello from TM1 " + version))
                .thenMany(tm1.cubes().modelCubes(ODataQuery.none().select(Cube.NAME)))
                .doOnNext(cube -> System.out.println("  " + cube.name()))
                .then()
                .block(); // fine at startup; in a web request, return the Flux instead
        }
    
    }
    Output
    Hello from TM1 11.8.03500.6

    Run it with ./gradlew bootRun (or mvn spring-boot:run).

Next: the beans it creates, and a session per user from the pool; several servers, each by name; logging in your own way, such as with CAM; and tm1-spring-boot-testcontainers, for a real TM1 in your Spring Boot tests.

New to it? Take it step by step: Add TM1 to a Spring Boot application.

Give each server a name under tm1.servers, with the same settings as tm1:

application-servers.yml
# src/main/resources/application.yml
tm1:
  servers:
    # Each server under a name of your choosing, with the same settings as tm1
    planning:
      address: http://localhost:8010
      user: admin
      password: ""
    reporting:
      address: http://localhost:8011
      user: admin
      password: ""

The starter builds a client for each, and a session pool for each that turns the pool on, with its metrics tagged server with the name. Ask for a server's client by its name, with @Qualifier:

Java
// With tm1.servers.planning.* and tm1.servers.reporting.*: a client for each
@Service
static class Reconciliation {

    private final Tm1Client planning;

    private final Tm1Client reporting;

    Reconciliation(@Qualifier("planning") Tm1Client planning, @Qualifier("reporting") Tm1Client reporting) {
        this.planning = planning;
        this.reporting = reporting;
    }

    // The cubes planning has and reporting doesn't
    Flux<String> notYetReported() {
        return cubes(reporting).collectList()
            .flatMapMany(reported -> cubes(planning).filter(cube -> !reported.contains(cube)));
    }

    private static Flux<String> cubes(Tm1Client tm1) {
        return tm1.cubes().modelCubes(ODataQuery.none().select(Cube.NAME)).map(Cube::name);
    }

}

The tm1 settings are the server named default, the same as tm1.servers.default; set one or the other. Its client is the one you get without a qualifier. Every other server's is injected only by its name, even when there's just one. In Spring Boot tests, Tm1EnvironmentServers from tm1-spring-boot-testcontainers wires in each server of a PlanningAnalyticsEnvironment by its name. Tm1ServersProperties has the details.

Hand this prompt to a coding agent to build a first prototype. It names the package, how to install it, the docs and the walkthroughs, and asks you for anything it can't work out.

Prompt Show the full promptHide the prompt
Build me a first prototype: a Spring Boot 4 application in Java that works with IBM Planning Analytics (TM1), using the Skipcheck TM1 Spring Boot starter: the package io.skipcheck:tm1-spring-boot-starter, version 0.1.1. The starter builds a TM1 client from the application's settings.

Before you write code, ask me what the application should do, unless I've said already. Suggest a small start, such as printing the server's version and listing its cubes at startup, then a REST endpoint that reads a few cells of a view. Then ask me for my TM1 server's REST address (it ends in /api/v1/) and login. Keep the password out of application.yml: read it from an environment variable.

1. Make a Spring Boot 4 application, if there isn't one (start.spring.io makes one). It needs Java 17 or later.
2. Add the starter:

Gradle (Kotlin):

```kotlin
implementation("io.skipcheck:tm1-spring-boot-starter:0.1.1")
```

Maven:

```xml
<dependency>
  <groupId>io.skipcheck</groupId>
  <artifactId>tm1-spring-boot-starter</artifactId>
  <version>0.1.1</version>
</dependency>
```

3. Write the code. This walkthrough does it step by step, with the settings and what it printed against a real TM1:

- Add TM1 to a Spring Boot application: https://skipcheck.io/tm1-spring-boot-starter/walkthroughs/first-app/

4. Look up the settings, the beans and each method you use in the docs: https://skipcheck.io/tm1-spring-boot-starter/docs/java/. The client's own docs are at https://skipcheck.io/tm1-client/docs/java/; they say where TM1 behaves in surprising ways, on the method it affects ("TM1 (11.8) ..."), so read them before working around an error. The landing pages, the walkthroughs and every type's overview are also in one file for agents: https://skipcheck.io/llms-full.txt
5. Start the application against my server, and show me what it printed.

If I don't have a TM1 server, one can run on this computer in Docker, from my own licensed TM1 Server download. These instructions set it up: tm1-setup for one server, pa-setup for more, or for TM1 Web, Workspace or Cognos security:

- pa-setup: https://raw.githubusercontent.com/ajmyers/skipcheck-tm1/v0.1.1/agent-plugin/skills/pa-setup/SKILL.md
  Set up a local IBM Planning Analytics environment in Docker with pa-setup and pa-environment.yaml, in any combination of TM1 servers (with a shared Admin Server), TM1 Web, Planning Analytics Workspace (PAW), and Cognos Analytics security (CAM) with test users through LDAP and OpenID Connect (Keycloak).
- tm1-setup: https://raw.githubusercontent.com/ajmyers/skipcheck-tm1/v0.1.1/agent-plugin/skills/tm1-setup/SKILL.md
  Set up and start one local IBM Planning Analytics (TM1) server in Docker with tm1-server's setup script, check that it's healthy, and troubleshoot it.

Open in Claude DesktopOpen in Claude Code

Either link fills in the prompt, and you press Enter to send it. "Open in Claude Code" is for the terminal app, and works once you've run claude on this computer. Another agent, such as Codex, Cursor or Gemini CLI? Copy the prompt.

  • Auto-configuration: a Tm1Client bean from tm1.* properties.
  • Several servers: a client per server under tm1.servers.<name>, injected by its name.
  • Session pooling and impersonation: a session per user, from a pool.
  • Your own login: replace the connection details, for example for CAM.
  • Tests: @ServiceConnection for a TM1 container, from tm1-spring-boot-testcontainers.