How to use POMs as a dependency in Maven?

后端 未结 5 1885
醉酒成梦
醉酒成梦 2020-11-29 22:16

Is there a way to add a pom type dependency to my POM and get all its modules?

JavaMail is a good example. Maven Central Repo has a parent POM called:

5条回答
  •  鱼传尺愫
    2020-11-29 23:18

    If the pom you're trying to import, contains dependencies defined in a section, and you would like to import them all, you can try the code below.

    (Disclaimer: I haven't done this in a while): in your section, add the pom dependency like this:

    
        
            
                kung.fu
                ninja
                1.2.3
                import
                pom 
            
        
    
    

    It may as well be the case that you define the dependency directly in the section not needing the bit, but as far as I recall, it should be scoped import as shown above.

提交回复
热议问题