How to configure a subproject dependency in Maven without deploying jars?

后端 未结 2 2183
清歌不尽
清歌不尽 2021-02-18 18:43

I googled this and it seems that no one has an answer, yet it seems like such an elementary thing that it should be possible.

I have the following project structure:

2条回答
  •  北恋
    北恋 (楼主)
    2021-02-18 19:38

    You should have a master pom at parent's level, in which you will list the modules of your project.

      
        sub-project1
        sub-project2>
      
    

    In each subproject you have to reference your parent:

    
        parent
        mygroup
        1.0-SNAPSHOT
    
    

    And you specify the dependencies between the project just as you did. I think you've missed some of the steps I've described.

    Edit: you should issue your mvn clean install at the parent level.

提交回复
热议问题