Bonsoir,

Comme le titre l'indique je voudrais utiliser un projet spring boot de type "java application Maven" comme dépendance dans un autre projet spring boot "java web application maven". Mais le soucis est que j'obtiens cette erreur:

Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$TransactionManagementConfiguration]; nested exception is java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to process import candidates for configuration class [org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration$TransactionManagementConfiguration]; nested exception is java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector
Caused by: java.lang.IllegalArgumentException: class org.springframework.transaction.annotation.TransactionManagementConfigurationSelector is not assignable to interface org.springframework.context.annotation.ImportSelector"}}
Voici le code susceptible de poser cette erreur; la classe de configuration du projet "java application":

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
@Configuration
@EnableAutoConfiguration
@EntityScan(basePackages = {"com.nhit.dev.entities"})
@EnableJpaRepositories(basePackages = {"com.nhit.dev.repositorydao"})
@ComponentScan(basePackages = {"com.nhit.dev.MetierImpl"})
@EnableTransactionManagement
public class ConfigurationMetier {
 
}
et la classe de configuration du projet "java web application":

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
@Configuration
//@EnableAutoConfiguration
//@Import(value = {
//        ConfigurationMetier.class
//} )
@ImportResource(
    { 
        "classpath:META-INF/cxf/cxf.xml" 
    })
@ComponentScan
public class MyConfig extends SpringBootServletInitializer{
}
Comment pourrais-je reparer ça et le faire propre?
Merci de votre éventuelle aide!