Maven parent pom variables are not resolved

前端 未结 2 1661
梦毁少年i
梦毁少年i 2021-01-06 17:16

I have the following POM structure:

./foobar-common/pom.xml ./abc-window/pom.xml ./abc-datasource/pom.xml

Both abc-window pom.xml is as follows:



        
2条回答
  •  长发绾君心
    2021-01-06 18:07

    Use dependencyManagment in parent pom

    
      
        
           junit
           junit
           ${junit.version}
        
        
           org.apache.commons
           commons-lang3
           ${commons-lang3.version}
        
        
        
    

    add all versions in parent pom, and use dependencies without version in children

    EDIT

    /pom.xml                 <-parent pom
    /abc-window/pom.xml     <-child module  
    /abc-datasource/pom.xml <-child module  
    

    and parent pom should contains

       
        ... 
         
         
          abc-datasource
          abc-window  
          
       
             
           ...
          
       
       
        ...  
         
    
    

提交回复
热议问题