-1

I am facing issue with exporting JAR as runnable from Eclipse.

Tried with maven plugin, spring-boot plugin & simple java project export. However, it shows spring.factories file related error. I have already copied and pasted it in the required folder after checking on google.

I need to export a spring-boot application which includes some 3rd party JARs and maven jars(to be downloaded from pom.xml) and properties file.

The Jar should be running from the console or using a batch file in the system.

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
      </plugins>
</build>
garima garg
  • 308
  • 1
  • 8
  • are you using springs auto-configuration? – locus2k Jul 23 '20 at 11:56
  • I have tried both. 1. maven build plugin and tried with clean install, clean re-package:repackage, clean test etc but itsn't working. 2. If I am correct, Yes I am using Springs auto-configuration. EnableAutoConifiguration annotation is used. Also, in pom.xml: com.tcs.stest.adapter.itsm.initBatch.Application Correct me if my understanding of auto-configuration is wrong as I am new to Springboot. – garima garg Jul 23 '20 at 12:46
  • Hi All: I think there was some missing plugins related to springboot application. I was creating springboot project and then adding maven dependencies. But after creating maven project, adding springboot dependencies worked. Thank you all for your time. (y) – garima garg Dec 27 '20 at 18:01

1 Answers1

0

Run the following command in Terminal

mvn install

With out test

mvn install -DskipTests

or

mvn install -DskipTests=true

the jar will be available in /target folder

Thirumal
  • 8,280
  • 11
  • 53
  • 103
  • I am getting below error for above command: Recompile with -Xlint:unchecked for details.[INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /C:/Users/pc/Desktop/xx/Eclipse-Workspace-Root/JAR_Creation_Example/NewAxway/src/main/java/com/*.java:[3,21] package com.*.*.bs does not exist – garima garg Jul 23 '20 at 13:00
  • `-Xlint:unchecked ` is deprecated warning. It's not the reason. Some `library` is missing which is required at `line 3`. Why don't you add all required dependencies in `pom.xml`? – Thirumal Jul 23 '20 at 13:08