Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
216 changes: 216 additions & 0 deletions automation-packages/templates/java/ap-with-common-library/ap1/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>ch.exense.step.examples</groupId>
<artifactId>ap1</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>

<name>Step AP Sample (with common library)</name>
<description>Sample Step automation package depending on a common library</description>
<url>https://step.exense.ch/</url>

<properties>
<!-- Java & encoding -->
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<!-- Dependency versions -->
<step.version>2025.10.24-68fb9841965ede24cfcc065b</step.version>
<step-api.version>2025.10.15-68ef62ad2c8af16504f37e13</step-api.version>

<!-- Maven plugins -->
<maven-compiler-plugin.version>3.12.1</maven-compiler-plugin.version>
<maven-shade-plugin.version>3.5.3</maven-shade-plugin.version>
<maven-surefire-plugin.version>3.5.1</maven-surefire-plugin.version>
</properties>

<repositories>
<!-- TODO: remove this repository after release of Step 29 -->
<repository>
<id>nexus-staging</id>
<url>https://nexus-enterprise-staging.exense.ch/repository/staging-maven/</url>
</repository>
</repositories>

<pluginRepositories>
<!-- TODO: remove this repository after release of Step 29 -->
<pluginRepository>
<id>nexus-staging</id>
<url>https://nexus-enterprise-staging.exense.ch/repository/staging-maven/</url>
</pluginRepository>
</pluginRepositories>

<profiles>
<!-- Execute the automation package on Step -->
<profile>
<id>execute-on-step</id>
<build>
<plugins>
<plugin>
<groupId>ch.exense.step</groupId>
<artifactId>step-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>execute-automation-package</goal>
</goals>
<phase>verify</phase>
<configuration>
<!-- Define the following settings in your settings.xml -->
<url>${step.url}</url>
<authToken>${step.auth-token}</authToken>
<stepProjectName>${step.step-project-name}</stepProjectName>

<waitForExecution>true</waitForExecution>
<ensureExecutionSuccess>true</ensureExecutionSuccess>
<executionResultTimeoutS>600</executionResultTimeoutS>
<executionParameters>
<env>TEST</env>
</executionParameters>
<libArtifactGroupId>ch.exense.step.examples</libArtifactGroupId>
<libArtifactId>library</libArtifactId>
<libArtifactVersion>1.0.0</libArtifactVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<!-- Deploy the automation package to Step -->
<profile>
<id>deploy-to-step</id>
<build>
<plugins>
<plugin>
<groupId>ch.exense.step</groupId>
<artifactId>step-maven-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<configuration>
<libArtifactGroupId>ch.exense.step.examples</libArtifactGroupId>
<libArtifactId>library</libArtifactId>
<libArtifactVersion>1.0.0</libArtifactVersion>
<url>${step.url}</url>
<authToken>${step.auth-token}</authToken>
<stepProjectName>${step.step-project-name}</stepProjectName>
</configuration>
<goals>
<goal>deploy-automation-package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
<!-- Step dependencies -->
<dependency>
<groupId>ch.exense.step</groupId>
<artifactId>step-api-keyword</artifactId>
<version>${step-api.version}</version>
<!-- The Keyword API is provided by the Step platform at runtime and doesn't have to be
added to the package. -->
<scope>provided</scope>
</dependency>

<!-- Common library -->
<dependency>
<groupId>ch.exense.step.examples</groupId>
<artifactId>library</artifactId>
<version>1.0.0</version>
<!-- The automation package library will be provided by the Step platform at runtime.
We therefore set it to provided so that it is not added to the uberjar -->
<scope>provided</scope>
</dependency>

<!-- JUnit runner for LOCAL automation package execution. -->
<dependency>
<groupId>ch.exense.step</groupId>
<artifactId>step-automation-packages-junit5</artifactId>
<version>${step.version}</version>
<!-- This dependency is only required for the local execution of the automation package
and shouldn't be packaged in the automation package. Keep the scope on test. -->
<scope>test</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven-shade-plugin.version}</version>
</plugin>
<plugin>
<groupId>ch.exense.step</groupId>
<artifactId>step-maven-plugin</artifactId>
<version>${step.version}</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>

<!-- Package the automation package as Uber-jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals><goal>shade</goal></goals>
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<reproducibleFileOrder>true</reproducibleFileOrder>
</configuration>
</execution>
</executions>
</plugin>

<!-- Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import step.handlers.javahandler.Keyword;

public class MyKeywords extends MyAbstractKeyword {

@Keyword
public void MyKeywordFromAp1() {
session.put(new CommonSession());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
schemaVersion: 1.0.0
name: "Automation Package 1"
plans:
- name: "Plan 1"
agents: auto_detect
root:
testCase:
children:
- callKeyword:
keyword: MyKeywordFromAp1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import step.junit5.runner.StepJUnit5;

public class AutomationPackageTest extends StepJUnit5 {
}
Loading