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

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

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应该可以在控制台上运行,或者可以在系统中使用批处理文件运行。

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</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.

&lt;build&gt;
    &lt;plugins&gt;
	    &lt;plugin&gt;
		    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
			&lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
    	&lt;/plugin&gt;
	  &lt;/plugins&gt;
&lt;/build&gt;

答案1

得分: 0

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

mvn install

不运行测试:

mvn install -DskipTests

或者

mvn install -DskipTests=true

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

英文:

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

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:

确定