#Common resources folder can't be accessed from different modules.

3 messages · Page 1 of 1 (latest)

real inlet
#

Hello! Has anyone taken the courses from Spring Academy? I need help with working with classpath across different modules.
One of their tutorials include a common resources folder which is later accessed by different labs. For some reason, the code is not working in my pc.

@Configuration
@Import(RewardsConfig.class)
public class TestInfrastructureConfig {


    @Bean
    public DataSource dataSource() {
        return (new EmbeddedDatabaseBuilder()) //
                .addScript("classpath:rewards/testdb/schema.sql") //
                .addScript("classpath:rewards/testdb/data.sql") //
                .build();
    }
}

The code is giving me FileNotFoundException. The sql files that I'm accessing is located in a common module called "00-rewards-common" module and my TestInfrastructureConfig class is inside "12-javaconfig-dependency-injection" module.

slim sigilBOT
#

This post has been reserved for your question.

Hey @real inlet! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.