0

Here is the pom.xml for our single module

    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   <slf4jVersion>1.7.7</slf4jVersion>
    <log4jVersion>1.2.17</log4jVersion>
</properties>

<dependencies>
    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-core</artifactId>
        <version>2.5.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-log4j</artifactId>
        <version>2.5.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-spring</artifactId>
        <version>2.5.0</version>
    </dependency>

    <dependency>
        <artifactId>commons-logging</artifactId>
        <groupId>commons-logging</groupId>
        <version>1.1.3</version>

    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

</dependencies>

We have many modules, when we run from intellji, there is no problem However when we try to convert single module to .jar and run it via - mvn clean install, we got this error.

Here is the error line

private static final Logger LOGGER = Logger.getLogger(ReadPropertiesFile.class);
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
hippalus
  • 11
  • 1
  • 4

1 Answers1

0

Please check if the module has the dependency, it may happen that while building with intellji it is using existing lib of inteliji but runtime it is not available.

refer--- link

Vawani
  • 399
  • 10
  • 25
  • hi Vawani, In modul target directory, typing "java -jar myApp.jar" is ok. If you copy the module jar file to any folder and run the command "java -jar myApp.jar" in the folder directory that folder, it gives this error. There are also parameter path and application.properties which are given in the module.If they run with the command "java -jar myApp.jar application.properties test.json test2.xml", it gives this error. What can I do? Thanks – hippalus Aug 04 '18 at 00:49
  • 1
    Build the jar with dependancy else while running jar please add the dependency jars on class path – Vawani Aug 04 '18 at 15:10
  • i think vawani correct because i can not see any build with dependencies option on the pom xml also run clean package command to import all dependencies into jar – Mithat Konuk Aug 04 '18 at 21:44
  • refer https://stackoverflow.com/questions/1814526/building-executable-jar-with-maven?rq=1 – Vawani Aug 05 '18 at 05:52