小编Ven*_*oda的帖子

使用 Maven 程序集插件在 META-INF/spring.factories 中找不到自动配置类

我正在使用下面的 Maven 程序集插件来打包 Spring Boot 应用程序。我正在使用这个插件,因为我对 spring-boot-maven 插件有一些其他问题。

    <plugin>
                <artifactId>maven-assembly-plugin</artifactId>

                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>com.gcc.news.publishing.Application</mainClass>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase> 
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
Run Code Online (Sandbox Code Playgroud)

当我使用它运行它时

java -Dspring.profiles.active=dev -jar target/gcc-news-publishing-service-0.0.1-SNAPSHOT-jar-with-dependencies.jar. 
Run Code Online (Sandbox Code Playgroud)

我低于异常。

Exception:
nested exception is java.lang.IllegalArgumentException
: No auto configuration classes found in META-INF/spring.factories. If you are u
sing a custom packaging, make sure that file is correct.
2018-07-12 22:20:56.031 ERROR 22836 --- [           main] o.s.boot.SpringApplica
tion               : Application startup failed

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to proces …
Run Code Online (Sandbox Code Playgroud)

java spring spring-boot

6
推荐指数
1
解决办法
8726
查看次数

标签 统计

java ×1

spring ×1

spring-boot ×1