Roberto
Roberto

Reputation: 1405

How to define in @ComponentScan path to java classes from another module?

There is spring-application with maven. I have root-module and two inner project modules: webapp and utils.

So, in utils I have @ComponentScan annotation and paths to source code.

Can I somehow define the path to webapp classes in webapp for use already wrote classes? I need just source codes in utils module

Upvotes: 0

Views: 108

Answers (1)

M. Asiyaban
M. Asiyaban

Reputation: 183

You need to define child modules in the pom.xml file parent module:

   <modules>
        <module>module-one</module>
        <module>module-two</module>
        <module>module-three</module>
    </modules>

Upvotes: 1

Related Questions