How to debug a project in Intellij while setting the breakpoints in another project

前端 未结 3 827
情深已故
情深已故 2021-01-05 19:49

I have a (Maven-based) project A loaded in Intellij that has a number of dependencies.

I have the source files of one of those dependencies (say B) in another Intell

3条回答
  •  一生所求
    2021-01-05 20:50

    When working with multiple maven projects, I find it convenient to put both under a parent maven project. The two child projects are not aware of the parent and remain independent of each other, but by aggregating them on one parent pom, you can conveniently build and test them at the same time, keeping the dependent in sync with its dependency. When you do that, you can also create Run configurations for each project, launch them in debug mode, and put breakpoints in either or both of them.

    The parent pom stays in the parent folder of both projects, and does not need to go into source control because the child poms don't refer to it as their parent--its only for your convenience in working on both at the same time. Such a pom might look like:

    
    
        4.0.0
    
        anything
        anything
        0.0-SNAPSHOT
        pom
        All projects
        
            project-1-subdirectory
            project-2-subdirectory
        
    
    

提交回复
热议问题