SpecFormula AI
安裝與導入

Java / Maven

Adopt SpecFormula with Maven and Cucumber JVM

The Java implementation is split into Maven modules:

ModulePurpose
specformula-coreISA parser, instruction engine, and symbol systems.
specformula-springSpring bridge, ScenarioContext, HTTP/auth/time adapters.
specformula-cucumberCucumber Backend SPI integration.
specformula-testcontainerTestcontainers database setup and cleanup.
specformula-dslDSL preprocessing Maven plugin.

Development install

Install Java modules into the local Maven repository from this repo:

cd specformula-java
mvn clean install -DskipTests

Test project dependencies

A minimal Cucumber setup usually needs:

<dependencies>
  <dependency>
    <groupId>ai.specformula</groupId>
    <artifactId>specformula-cucumber</artifactId>
    <version>${specformula.version}</version>
    <scope>test</scope>
  </dependency>

  <dependency>
    <groupId>ai.specformula</groupId>
    <artifactId>specformula-testcontainer</artifactId>
    <version>${specformula.version}</version>
    <scope>test</scope>
  </dependency>
</dependencies>

specformula-cucumber is loaded through Cucumber Backend SPI; test execution remains standard Cucumber / JUnit Platform.

Enable DSL preprocessing

If the test project uses .dsl.feature, add the specformula-dsl Maven plugin. The plugin runs in generate-test-sources: it reads the source tree, writes generated test resources, and does not modify build output in place.

<build>
  <plugins>
    <plugin>
      <groupId>ai.specformula</groupId>
      <artifactId>specformula-dsl</artifactId>
      <version>${specformula.version}</version>
      <executions>
        <execution>
          <goals>
            <goal>preprocess</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

If you need Cucumber failures to trace back to DSL source, add the current test-time support from specformula-dsl as implemented in the repo.

Run tests

mvn test

On this page