Compilation error - package com.google.gson not found in Redhat “Openshift” application

前端 未结 1 893
旧时难觅i
旧时难觅i 2021-01-24 10:45

I am devleoping application in openshift using Eclipse Luna which make use of gson jars.

I added gson jar files in the Web-inf/lib folder and it is not showing any error

相关标签:
1条回答
  • 2021-01-24 11:35

    OK ! i got it. For any external jars that you add in the libraries in java openshift application, you have to show the dependency in the pom.xml file This file is in webapps folder i.e. webapps/pom.xml.

    I used gson-2.1.jar, so the corresponding dependency is :-

    <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.1</version>
    </dependency>
    

    Thanks to me :)

    0 讨论(0)
提交回复
热议问题