LeanFT

How to Add LeanFT Dependency in Maven

Maven is an important component of a Test Automation Framework. If you want to add LeanFT dependencies in Maven, you need to perform the following steps:-

  1. Install Maven on your system. Mkyong explains it beautifully in his post here.
  2. Execute the following 2 commands on your command prompt to add the LeanFT Jars in your local maven repository:-
mvn install:install-file -Dfile="LeanFT Installation Directory\SDK\Java\com.hp.lft.sdk-standalone.jar" -DgroupId="com.hp.lft" -DartifactId="sdk" -Dversion=14.0.0 -Dpackaging=JAR -DgeneratePom=true

mvn install:install-file -Dfile="LeanFT Installation Directory\SDK\Java\com.hp.lft.report.jar" -DgroupId="com.hp.lft" -DartifactId="report" -Dversion=14.0.0 -Dpackaging=JAR -DgeneratePom=true

mvn install:install-file -Dfile="LeanFT Installation Directory\SDK\Java\com.hp.lft.unittesting.jar" -DgroupId="com.hp.lft" -DartifactId="unittesting" -Dversion=14.0.0 -Dpackaging=JAR -DgeneratePom=true

mvn install:install-file -Dfile="LeanFT Installation Directory\SDK\Java\com.hp.lft.verifications.jar" -DgroupId="com.hp.lft" -DartifactId="verifications" -Dversion=14.0.0 -Dpackaging=JAR -DgeneratePom=true

mvn install:install-file -Dfile="LeanFT Installation Directory\SDK\Java\com.hp.lft.sdk-javadoc.jar" -DgroupId="com.hp.lft" -DartifactId="sdk" -Dversion=14.0.0 -Dclassifier=Javadoc -Dpackaging=JAR -DgeneratePom=true

mvn install:install-file -Dfile="LeanFT Installation Directory\SDK\Java\com.hp.lft.common.jar" -DgroupId="com.hp.lft" -DartifactId="common" -Dversion=14.0.0 -Dpackaging=JAR -DgeneratePom=true

mvn install:install-file -Dfile="LeanFT Installation Directory\SDK\Java\com.hp.lft.reportbuilder-standalone.jar" -DgroupId="com.hp.lft" -DartifactId="reportbuilder" -Dversion=14.0.0 -Dpackaging=JAR -DgeneratePom=true

3. Add the Following dependencies in your pom.XML:-


<dependency>
    <groupId>com.hp.lft</groupId>
    <artifactId>sdk</artifactId>
    <version>14.0.0</version>
</dependency>

<dependency>
    <groupId>com.hp.lft</groupId>
    <artifactId>sdk</artifactId>
    <version>14.0.0</version>
    <classifier>javadoc</classifier>
</dependency>

<dependency>
    <groupId>com.hp.lft</groupId>
    <artifactId>report</artifactId>
    <version>14.0.0</version>
</dependency>

<dependency>
    <groupId>com.hp.lft</groupId>
    <artifactId>unittesting</artifactId>
    <version>14.0.0</version>
</dependency>

<dependency>
    <groupId>com.hp.lft</groupId>
    <artifactId>verifications</artifactId>
    <version>14.0.0</version>
</dependency>

<dependency>
    <groupId>com.hp.lft</groupId>
    <artifactId>reportbuilder</artifactId>
    <version>14.0.0</version>
</dependency>

<dependency>
    <groupId>com.hp.lft</groupId>
    <artifactId>common</artifactId>
    <version>14.0.0</version>
</dependency>

Please note that the version specified in the Command line arguments and the pom.XML would change depending on the version of LeanFT installed on your machine.

Happy Automating !

Harshit Kohli

Advertisements

Categories: LeanFT

Tagged as: , , ,

8 replies »

      • Actually i did few modifications as i have uploaded all leanft jars in repository and now downloading from that directly. Below are modified POM.

        com.citi
        com.hp.lft.sdk
        12.52.0-standalone

        com.citi.docs
        com.hp.lft.sdk
        12.52.0-javadoc

        com.citi
        com.hp.lft.report
        12.52.0

        com.citi
        com.hp.lft.unittesting
        12.52.0

        com.citi
        com.hp.lft.verifications
        12.52.0

        junit
        junit.core
        4.11.0

        junit
        junit
        4.8.2
        provided

        So it is successfully downloading the jars but when i am trying to build this pom it is throwing build failure with below error.

        error: cannot find symbol
        symbol: class SampleScreenModel
        location: class SampleLeanftTest

        Please help me on resolving this issue.
        Thank you in advance. 🙂

  1. Hi. We installed leanft jars correctly using maven. But we are unable to see leanft Maven project in eclipse. Even we add dependencies externally, we are facing errors. Please help us.

    • Hi Mahesh,

      Can you find the jars in the local m2 folder on your machine ? If not, then the mvn install command might not have been executed properly. If the jars are present, then you should make sure that the information that you are specifying in the POM file must be accurate.

      If nothing works, you can probably try giving systempath property for the leanft dependencies so that you can specify where the jar is present on your machine.

      Hope this works for you.

      Regards,
      Harshit

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s