opendaylight(Li) l2switch 源代码分析(2)--parent

本文主要介绍l2switch中的parent工程,该工程定义了运行L2switch所使用的依赖模块以及版本等。
该工程下只有一个pom.xml文件,下面对该文件中的主要内容进行说明:

1.

    org.opendaylight.odlparent
    odlparent
    1.7.0-SNAPSHOT
   

该工程继承了工程“org.opendaylight.odlparent”,这个工程在l2 switch中不存在,查看opendaylight
的github(https://github.com/opendaylight/odlparent),确实有一个odlparent工程,查看该工程
的pom.xml:

   org.opendaylight.odlparent
   odlparent-lite
   1.7.0-SNAPSHOT
   odlparent-lite

貌似odlparent还继承于odlparent-lite,在odlparent工程目录下找到了odlparent-lite文件下的pom.xml,
貌似该pom.xml不再继承于其他的工程,应该找到源头了。
后面会介绍到其他的工程,如packethandler、loopremover等,它们的pom.xml都会继承于parent工程,即在
这些工程的pom.xml下面都有一下内容:
   
        org.opendaylight.l2switch
        l2switch-parent
        0.4.0-SNAPSHOT
        ../parent
   


2.
 
   
     
        org.opendaylight.yangtools
        yangtools-artifacts
        ${yangtools.version}
        import
        pom
     

     
        org.opendaylight.mdsal
        mdsal-artifacts
        2.1.0-SNAPSHOT
        import
        pom
     

     
        org.opendaylight.mdsal.model
        mdsal-model-artifacts
        0.9.0-SNAPSHOT
        import
        pom
     

     
        org.opendaylight.controller
        config-artifacts
        ${config.version}
        import
        pom
     

     
        org.opendaylight.controller
        mdsal-artifacts
        ${mdsal.version}
        import
        pom
     

     
        org.opendaylight.openflowplugin
        openflowplugin-artifacts
        ${openflow.plugin.version}
        import
        pom
     

     
        org.opendaylight.l2switch
        l2switch-artifacts
        ${project.version}
        import
        pom
     


     
        org.opendaylight.controller.thirdparty
        net.sf.jung2
        ${jung2.version}
     

   

 

这边定义了l2switch需要依赖的工程:yangtools,mdsal,controller,openflowplugin,jung2......
子pom会继承父pom中配置的所有依赖,子pom中只需配置自己特需的依赖就行了。

3.
 
     
         
             
                  org.apache.maven.plugins
                  maven-compiler-plugin
                  ${maven.compile.plugin.version}
                 
                      ${java.version.source}
                      ${java.version.target}
                 

             


             
                org.apache.maven.plugins
                maven-checkstyle-plugin
                ${checkstyle.version}
               
                  true
                  controller/checkstyle.xml
                  true
                  true
                  ${project.basedir}
                  **\/*.java,**\/*.yang,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat
                  **\/target\/,**\/bin\/,**\/target-ide\/,\/,**\/xtend-gen\/,**\/yang-gen-code\/,**\/${codeGeneratorPath}\/,**\/${configCodeGeneratorPath}\/,
               

               
                 
                    org.opendaylight.controller
                    checkstyle
                    0.3.0-SNAPSHOT
                 

               

               
                 
                    check
                   
                      check
                   

                    process-sources
                 

               

             


             
             
                  org.codehaus.mojo
                  build-helper-maven-plugin
                  1.8
                 
                     
                          add-source
                         
                              add-source
                         

                          generate-sources
                         
                             
                                  src/main/yang
                                  ${codeGeneratorPath}
                                  ${configCodeGeneratorPath}
                             

                         

                     

                 

             

             
             
                  maven-clean-plugin
                 
                     
                         
                              ${codeGeneratorPath}
                              ${configCodeGeneratorPath}
                             
                                  **
                             

                         

                     

                 

             


             
             
                  org.eclipse.m2e
                  lifecycle-mapping
                  1.0.0
                 
                     
                         
                             
                                 
                                      org.codehaus.mojo
                                      properties-maven-plugin
                                      [0.0,)
                                     
                                          set-system-properties
                                     

                                 

                                 
                                     
                                 

                             

                             
                                 
                                      org.jacoco
                                      jacoco-maven-plugin
                                      [0.0,)
                                     
                                          prepare-agent
                                          pre-test
                                          post-test
                                     

                                 

                                 
                                     
                                 

                             

                             
                                 
                                      org.ops4j.pax.exam
                                      maven-paxexam-plugin
                                      [1.2.4,)
                                     
                                          generate-depends-file
                                     

                                 

                                 
                                     
                                          false
                                     

                                 

                             

                             
                                 
                                      org.apache.maven.plugins
                                      maven-checkstyle-plugin
                                      [2.0,)
                                     
                                          check
                                     

                                 

                                 
                                     
                                 

                             

                             
                                 
                                      org.opendaylight.yangtools
                                      yang-maven-plugin
                                      [0.5,)
                                     
                                          generate-sources
                                     

                                 

                                 
                                     
                                 

                             

                             
                                 
                                      org.codehaus.groovy.maven
                                      gmaven-plugin
                                      1.0
                                     
                                          execute
                                     

                                 

                                 
                                     
                                 

                             

                             
                                 
                                      org.apache.maven.plugins
                                      maven-enforcer-plugin
                                      ${enforcer.version}
                                     
                                          enforce
                                     

                                 

                                 
                                     
                                 

                             

                         

                     

                 

             

         

     

     
         
            org.codehaus.mojo
            build-helper-maven-plugin
         

         
              org.apache.maven.plugins
              maven-checkstyle-plugin
         

     

 

这一段定义了在编译时用到的插件。

你可能感兴趣的:(opendaylight)