简体   繁体   中英

Multiple module projects with intellij

I have 2 projects, ProjectA and ProjectB. ProjectB is a standalone project and ProjectA is dependent on ProjectB. Of course the pom in ProjectA has the dependency of ProjectB as follow:

 <overlays>
        <overlay>
            <groupId>ProjectB</groupId>
            <artifactId>ProjectBwar</artifactId>
        </overlay>
    </overlays>

...

 <dependency>
        <groupId>ProjectB</groupId>
                <artifactId>ProjectBwar</artifactId>
                <version>ProjectBVersion</version>
                <type>war</type>
</dependency>

When working with only ProjectA, everything is fine. Once I import module of ProjectB into the same project, Intellij is importing it fine but it's still using the maven dependency on the build and I'm unable to do any testing on changes done in ProjectB. Is there a way to tell Intellij to not use the maven dependency and instead use the module I have imported? I've tried going into the project structure, but I'm unsure of where to go and what to change. Any help would be appreciated! Thanks!

Add your library module as a project dependency, and any changes to your library will be visible in your project immediately. Assuming you have both your project and library modules within your IntelliJ project, go to:

File > Project Structure > Modules > select your project module > Dependencies > + > Module Dependency > select your library module

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM