
wrote a program that spans a few classes in IntelliJ and it works fine when I was testing it in the IDE. dao.PersistenceExceptionTranslationAutoConfiguration,\ context.PropertyPlaceholderAutoConfiguration,\ context.MessageSourceAutoConfiguration,\ context.ConfigurationPropertiesAutoConfiguration,\ admin.SpringApplicationAdminJmxAutoConfiguration,\ condition.ConditionEvaluationReportAutoConfigurationImportListener logging.AutoConfigurationReportLoggingInitializer SharedMetadataReaderFactor圜ontextInitializer,\ Here's my current spring.factories file: # Initializers To get spring boot to work after shading the jar, I simulated the same by merging the contents of all available spring.factories files into a single spring.factories file in my own jar's META-INF folder. This walks the context classloader for all resources of type META-INF/spring.factories. Spring.factories is loaded by the AutoConfigurationImportSelector class in spring-boot-autoconfigure. Just try java -jar target/mavenproject1-0.0.1-SNAPSHOT.jar, and it will hopefully work. I changed my packaging to the spring-boot-maven-plugin and it generates two files: mavenproject1-0.0.1-SNAPSHOT.jar and mavenproject1-0.0. I think that because it's a Spring Boot application, you need to use their plug-in. This file gave the same problem as you mentioned when I tried running it. I had the same problem and just solved it.Īt first, I was generating the fat jar with the maven-assembly-plugin, which created a file called mavenproject1-0.0.1-SNAPSHOT-jar-with-dependencies.jar.
#Intellij jar does not include files how to
How to add it, and what should be the content of this file? 15

It looks like it doesn't found auto configuration classes in META-INF/spring.factories. If you are using a custom packaging, make sure that file is correct.Īt .notEmpty(Assert.java:276)Īt .EnableAutoConfigurationImportSelector.getCandidateConfigurations(EnableAutoConfigurationImportSelector.java:145)Īt .lectImports(EnableAutoConfigurationImportSelector.java:84)Īt .ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:481) If you are using a custom packaging, make sure that file is correct.Īt .ConfigurationClassParser.processDeferredImportSelectors(ConfigurationClassParser.java:489)Īt .ConfigurationClassParser.parse(ConfigurationClassParser.java:191)Īt .ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:321)Īt .ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:243)Īt .PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:273)Īt .PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:98)Īt .AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:681)Īt .AbstractApplicationContext.refresh(AbstractApplicationContext.java:523)Īt .(EmbeddedWebApplicationContext.java:122)Īt .refresh(SpringApplication.java:759)Īt .refreshContext(SpringApplication.java:369)Īt .run(SpringApplication.java:313)Īt .run(SpringApplication.java:1185)Īt .run(SpringApplication.java:1174)Ĭaused by: : No auto configuration classes found in META-INF/spring.factories. BeanDefinitionStoreException: Failed to process import candidates for configuration class nested exception is : No auto configuration classes found in META-INF/spring.factories. I got this: 16:37:44.194 ERROR - Application startup failed But when I made a fat jar and executed it with java -jar myapp.jar Everything was working fine when starting my app using IntelliJ.
