Exception in thread "main" java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories

huangapple 未分类评论43阅读模式
英文:

Exception in thread "main" java.lang.IllegalArgumentException: No auto configuration classes found in META-INF/spring.factories

问题

我在从Eclipse导出可运行的JAR时遇到了问题。

尝试过使用maven插件spring-boot插件简单的Java项目导出
然而,它显示了与spring.factories文件相关的错误。我已经在查阅了谷歌后,在所需文件夹中复制并粘贴了它。

我需要导出一个包括一些第三方JAR和从pom.xml中下载的maven JAR以及属性文件的spring-boot应用

这个JAR应该可以在控制台上运行,或者可以在系统中使用批处理文件运行。

  1. <build>
  2. <plugins>
  3. <plugin>
  4. <groupId>org.springframework.boot</groupId>
  5. <artifactId>spring-boot-maven-plugin</artifactId>
  6. </plugin>
  7. </plugins>
  8. </build>
英文:

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

Tried with maven plugin, spring-boot plugin &amp; 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.

  1. &lt;build&gt;
  2. &lt;plugins&gt;
  3. &lt;plugin&gt;
  4. &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
  5. &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
  6. &lt;/plugin&gt;
  7. &lt;/plugins&gt;
  8. &lt;/build&gt;

答案1

得分: 0

在“终端”中运行以下命令:

  1. mvn install

不运行测试:

  1. mvn install -DskipTests

或者

  1. mvn install -DskipTests=true

JAR 文件将在 /target 文件夹中可用。

英文:

Run the following command in Terminal

  1. mvn install

With out test

  1. mvn install -DskipTests

or

  1. mvn install -DskipTests=true

the jar will be available in /target folder

huangapple
  • 本文由 发表于 2020年7月23日 19:46:22
  • 转载请务必保留本文链接:https://java.coder-hub.com/63053512.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定