Search code examples
javaeclipsemavenseleniumreportng

How to add one standalone project into another maven project


I have a standalone maven selenium project which is working perfectly fine, now I want my reports to be generated using ReportNG and for which I would be doing some customisation to already developed ReportNG code.

To customize the ReportNG code, I need to download the code and add it to my current maven-selenium project.

Could anybody suggest, how do I add that ReportNG code to my maven project and interact with the ReportNG code?

any help would be appreciated.


Solution

  • You can make those projects into two different modules under single project.

    Project structure:

    /test_sample
    --/maven-selenium
    --/ReportNG
    

    Root pom.xml:

    <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/maven-v4_0_0.xsd">
            <modelVersion>4.0.0</modelVersion>
            <groupId>com.test.sample</groupId>
            <artifactId>test_sample</artifactId>
            <version>1.0</version>
            <packaging>pom</packaging>
    
            <modules>
                <module>maven-selenium</module>
                <module>ReportNG</module>
            </modules>    
    
        </project>
    

    Note: You can also add ReportNG as a dependency to maven-selenium module as per requirement.