Does the code written in @BeforeTest, @AfterTest gets included in the package created in TestProject when we upload the jar file?

Does the code written in @BeforeTest, @AfterTest gets included in the package created in TestProject when we upload the jar file? I am using Maven project with TestNG. I had @BeforeTest, @AfterTest and 2 @Test. After uploading the jar file with dependencies, I can only see the 2 tests which were mentioned as @Test in the created package . Because of this I am getting error while executing the test from TestProject as my code for Driverbuilder is inside @BeforeTest.

ChromeDriver driver;

public void setup() throws Exception {
driver = new DriverBuilder(new ChromeOptions())
.withRemoteAddress(new URL(“http://localhost:8585”))

Error I am getting is - “Failed to execute test ‘test1’ on Chrome: null” ; Failed to execute test ‘test2’ on Chrome: null

I removed the @BeforeTest and added the DriverBuilder code inside the @Test,created & uploaded the jar file, then created the package, again executed the test but now my test fails with error :
Failed to create an instance of io.testproject.sdk.drivers.web.ChromeDriver
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:17:03’
System info: host: ‘XXXXXXX’, ip: ‘XXXXXX’, ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘13.0.1’
Driver info: driver.version: unknown

I am working with Java 11, using Test Agent Version 3.5, java-sdk 1.3.0-RELEASE and TestNG 7.5 version. All tests are getting executed in Eclipse successfully.

Hi @parulgoyal ,

Yes, it is included in the package.
This JAR must contain all the dependencies (including TestProject SDK) and your unit tests (JUnit / TestNG).
Since unit Tests are not packaged by default, they must be included explicitly during build.
More valuable information about maven projects you can find here:

Let me know if you have managed.

Hi @alex.ivanov,

Thank you for the reply.

I have used the pom.xml and Assembly descriptor as mentioned in the article mentioned by you.
3 jars were created "TestProjectSDKDemo-0.0.1-SNAPSHOT.jar", “TestProjectSDKDemo-0.0.1-SNAPSHOT-test-jar-with-dependencies.jar” and “TestProjectSDKDemo-0.0.1-SNAPSHOT-tests.jar”. I uploaded “TestProjectSDKDemo-0.0.1-SNAPSHOT-test-jar-with-dependencies.jar”.

But getting errors as mentioned in my original post.

Here is my pom.xml:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

	<!-- -->
	<!-- -->
        <!-- Use maven-jar-plugin to include tests -->
        <!-- Use maven-assembly-plugin plugin with a custom descriptor -->
                    <!-- Path to the descriptor file -->

Here is my Assembly descriptor:

<assembly xmlns=""