Articles
Help Articles
How to create jar file from Java project with TestProject SDK and upload it as a coded test
Download Java SDK from Integrations under Develop an Addon.
Add the downloaded Jar to the project.
In Intellij, go to file > project structure (ctrl + alt + shift + s with keyboard shortcut) > Modules > Dependencies > click on the plus button > Jars and > select the Jar and click Ok > click Apply and Ok to close settings.
In Eclipse, Right click on your project > select Build Path > click on Configure
Build Path > click on Libraries and select Add External JARs > select the jar file > click Apply and Ok.
Add dependency in pom.xml file for Maven
1
<dependency>
2
<groupId>io.testproject</groupId>
3
<artifactId>java-sdk</artifactId>
4
<version>0.63.1</version>
5
<systemPath>/path/to/sdk/io.testproject.sdk.java.jar</systemPath>
6
<scope>system</scope>
7
</dependency>
Copied!
Or in build.gradle file for Gradle
1
dependencies {
2
compile files('>/path/to/sdk/io.testproject.sdk.java.jar')
3
}
Copied!
Write your tests. Keep in mind Implicit Project and Job Names.
Add file named testproject-sdk.properties under resources folder with the content version=0.63.1 (or other version if you prefer).
Run Maven commands Clean > Compile > Package. You will see a Jar file under target in the project tree.
Or Gradle commands Clean > Build > Jar. You will see the Jar file under build > libs
In TestProject go to your project and click on Add a new Test > select Code test type > drag the Jar file to the upload area and click on Upload > click Next > provide (meaningful!) package name, you can add Description and Application as well > finish the wizard.
Copy link