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

2024-04-14 21:38

本文主要是介绍opendaylight(Li) l2switch 源代码分析(2)--parent,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

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

1.
<parent>
    <groupId>org.opendaylight.odlparent</groupId>
    <artifactId>odlparent</artifactId>
    <version>1.7.0-SNAPSHOT</version>
    <relativePath/>
</parent>
该工程继承了工程“org.opendaylight.odlparent”,这个工程在l2 switch中不存在,查看opendaylight
的github(https://github.com/opendaylight/odlparent),确实有一个odlparent工程,查看该工程
的pom.xml:
<parent>
   <groupId>org.opendaylight.odlparent</groupId>
   <artifactId>odlparent-lite</artifactId>
   <version>1.7.0-SNAPSHOT</version>
   <relativePath>odlparent-lite</relativePath>
</parent>
貌似odlparent还继承于odlparent-lite,在odlparent工程目录下找到了odlparent-lite文件下的pom.xml,
貌似该pom.xml不再继承于其他的工程,应该找到源头了。
后面会介绍到其他的工程,如packethandler、loopremover等,它们的pom.xml都会继承于parent工程,即在
这些工程的pom.xml下面都有一下内容:
    <parent>
        <groupId>org.opendaylight.l2switch</groupId>
        <artifactId>l2switch-parent</artifactId>
        <version>0.4.0-SNAPSHOT</version>
        <relativePath>../parent</relativePath>
    </parent>

2.
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.opendaylight.yangtools</groupId>
        <artifactId>yangtools-artifacts</artifactId>
        <version>${yangtools.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.mdsal</groupId>
        <artifactId>mdsal-artifacts</artifactId>
        <version>2.1.0-SNAPSHOT</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.mdsal.model</groupId>
        <artifactId>mdsal-model-artifacts</artifactId>
        <version>0.9.0-SNAPSHOT</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>config-artifacts</artifactId>
        <version>${config.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.controller</groupId>
        <artifactId>mdsal-artifacts</artifactId>
        <version>${mdsal.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.openflowplugin</groupId>
        <artifactId>openflowplugin-artifacts</artifactId>
        <version>${openflow.plugin.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
      <dependency>
        <groupId>org.opendaylight.l2switch</groupId>
        <artifactId>l2switch-artifacts</artifactId>
        <version>${project.version}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>

      <dependency>
        <groupId>org.opendaylight.controller.thirdparty</groupId>
        <artifactId>net.sf.jung2</artifactId>
        <version>${jung2.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
这边定义了l2switch需要依赖的工程:yangtools,mdsal,controller,openflowplugin,jung2......
子pom会继承父pom中配置的所有依赖,子pom中只需配置自己特需的依赖就行了。

3.
  <build>
      <pluginManagement>
          <plugins>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <version>${maven.compile.plugin.version}</version>
                  <configuration>
                      <source>${java.version.source}</source>
                      <target>${java.version.target}</target>
                  </configuration>
              </plugin>

              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.version}</version>
                <configuration>
                  <failsOnError>true</failsOnError>
                  <configLocation>controller/checkstyle.xml</configLocation>
                  <consoleOutput>true</consoleOutput>
                  <includeTestSourceDirectory>true</includeTestSourceDirectory>
                  <sourceDirectory>${project.basedir}</sourceDirectory>
                  <includes>**\/*.java,**\/*.yang,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
                  <excludes>**\/target\/,**\/bin\/,**\/target-ide\/,\/,**\/xtend-gen\/,**\/yang-gen-code\/,**\/${codeGeneratorPath}\/,**\/${configCodeGeneratorPath}\/,</excludes>
                </configuration>
                <dependencies>
                  <dependency>
                    <groupId>org.opendaylight.controller</groupId>
                    <artifactId>checkstyle</artifactId>
                    <version>0.3.0-SNAPSHOT</version>
                  </dependency>
                </dependencies>
                <executions>
                  <execution>
                    <id>check</id>
                    <goals>
                      <goal>check</goal>
                    </goals>
                    <phase>process-sources</phase>
                  </execution>
                </executions>
              </plugin>

              <!--  tells eclipse to import these folders into the package explorer as "source" folders
                    which allows eclipse to resolve the classes correctly during an eclipse build -->
              <plugin>
                  <groupId>org.codehaus.mojo</groupId>
                  <artifactId>build-helper-maven-plugin</artifactId>
                  <version>1.8</version>
                  <executions>
                      <execution>
                          <id>add-source</id>
                          <goals>
                              <goal>add-source</goal>
                          </goals>
                          <phase>generate-sources</phase>
                          <configuration>
                              <sources>
                                  <source>src/main/yang</source>
                                  <source>${codeGeneratorPath}</source>
                                  <source>${configCodeGeneratorPath}</source>
                              </sources>
                          </configuration>
                      </execution>
                  </executions>
              </plugin>
              <!--  cleans up auto generated code  -->
              <plugin>
                  <artifactId>maven-clean-plugin</artifactId>
                  <configuration>
                      <filesets>
                          <fileset>
                              <directory>${codeGeneratorPath}</directory>
                              <directory>${configCodeGeneratorPath}</directory>
                              <includes>
                                  <include>**</include>
                              </includes>
                          </fileset>
                      </filesets>
                  </configuration>
              </plugin>

              <!-- Ignore/Execute plugin execution -->
              <plugin>
                  <groupId>org.eclipse.m2e</groupId>
                  <artifactId>lifecycle-mapping</artifactId>
                  <version>1.0.0</version>
                  <configuration>
                      <lifecycleMappingMetadata>
                          <pluginExecutions>
                              <pluginExecution>
                                  <pluginExecutionFilter>
                                      <groupId>org.codehaus.mojo</groupId>
                                      <artifactId>properties-maven-plugin</artifactId>
                                      <versionRange>[0.0,)</versionRange>
                                      <goals>
                                          <goal>set-system-properties</goal>
                                      </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                      <ignore />
                                  </action>
                              </pluginExecution>
                              <pluginExecution>
                                  <pluginExecutionFilter>
                                      <groupId>org.jacoco</groupId>
                                      <artifactId>jacoco-maven-plugin</artifactId>
                                      <versionRange>[0.0,)</versionRange>
                                      <goals>
                                          <goal>prepare-agent</goal>
                                          <goal>pre-test</goal>
                                          <goal>post-test</goal>
                                      </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                      <ignore />
                                  </action>
                              </pluginExecution>
                              <pluginExecution>
                                  <pluginExecutionFilter>
                                      <groupId>org.ops4j.pax.exam</groupId>
                                      <artifactId>maven-paxexam-plugin</artifactId>
                                      <versionRange>[1.2.4,)</versionRange>
                                      <goals>
                                          <goal>generate-depends-file</goal>
                                      </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                      <execute>
                                          <runOnIncremental>false</runOnIncremental>
                                      </execute>
                                  </action>
                              </pluginExecution>
                              <pluginExecution>
                                  <pluginExecutionFilter>
                                      <groupId>org.apache.maven.plugins</groupId>
                                      <artifactId>maven-checkstyle-plugin</artifactId>
                                      <versionRange>[2.0,)</versionRange>
                                      <goals>
                                          <goal>check</goal>
                                      </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                      <ignore />
                                  </action>
                              </pluginExecution>
                              <pluginExecution>
                                  <pluginExecutionFilter>
                                      <groupId>org.opendaylight.yangtools</groupId>
                                      <artifactId>yang-maven-plugin</artifactId>
                                      <versionRange>[0.5,)</versionRange>
                                      <goals>
                                          <goal>generate-sources</goal>
                                      </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                      <execute />
                                  </action>
                              </pluginExecution>
                              <pluginExecution>
                                  <pluginExecutionFilter>
                                      <groupId>org.codehaus.groovy.maven</groupId>
                                      <artifactId>gmaven-plugin</artifactId>
                                      <versionRange>1.0</versionRange>
                                      <goals>
                                          <goal>execute</goal>
                                      </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                      <ignore />
                                  </action>
                              </pluginExecution>
                              <pluginExecution>
                                  <pluginExecutionFilter>
                                      <groupId>org.apache.maven.plugins</groupId>
                                      <artifactId>maven-enforcer-plugin</artifactId>
                                      <versionRange>${enforcer.version}</versionRange>
                                      <goals>
                                          <goal>enforce</goal>
                                      </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                      <ignore />
                                  </action>
                              </pluginExecution>
                          </pluginExecutions>
                      </lifecycleMappingMetadata>
                  </configuration>
              </plugin>
          </plugins>
      </pluginManagement>
      <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-checkstyle-plugin</artifactId>
          </plugin>
      </plugins>
  </build>
这一段定义了在编译时用到的插件。

这篇关于opendaylight(Li) l2switch 源代码分析(2)--parent的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/904094

相关文章

MyBatis Plus 中 update_time 字段自动填充失效的原因分析及解决方案(最新整理)

《MyBatisPlus中update_time字段自动填充失效的原因分析及解决方案(最新整理)》在使用MyBatisPlus时,通常我们会在数据库表中设置create_time和update... 目录前言一、问题现象二、原因分析三、总结:常见原因与解决方法对照表四、推荐写法前言在使用 MyBATis

Python主动抛出异常的各种用法和场景分析

《Python主动抛出异常的各种用法和场景分析》在Python中,我们不仅可以捕获和处理异常,还可以主动抛出异常,也就是以类的方式自定义错误的类型和提示信息,这在编程中非常有用,下面我将详细解释主动抛... 目录一、为什么要主动抛出异常?二、基本语法:raise关键字基本示例三、raise的多种用法1. 抛

github打不开的问题分析及解决

《github打不开的问题分析及解决》:本文主要介绍github打不开的问题分析及解决,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、找到github.com域名解析的ip地址二、找到github.global.ssl.fastly.net网址解析的ip地址三

Mysql的主从同步/复制的原理分析

《Mysql的主从同步/复制的原理分析》:本文主要介绍Mysql的主从同步/复制的原理分析,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录为什么要主从同步?mysql主从同步架构有哪些?Mysql主从复制的原理/整体流程级联复制架构为什么好?Mysql主从复制注意

java -jar命令运行 jar包时运行外部依赖jar包的场景分析

《java-jar命令运行jar包时运行外部依赖jar包的场景分析》:本文主要介绍java-jar命令运行jar包时运行外部依赖jar包的场景分析,本文给大家介绍的非常详细,对大家的学习或工作... 目录Java -jar命令运行 jar包时如何运行外部依赖jar包场景:解决:方法一、启动参数添加: -Xb

Apache 高级配置实战之从连接保持到日志分析的完整指南

《Apache高级配置实战之从连接保持到日志分析的完整指南》本文带你从连接保持优化开始,一路走到访问控制和日志管理,最后用AWStats来分析网站数据,对Apache配置日志分析相关知识感兴趣的朋友... 目录Apache 高级配置实战:从连接保持到日志分析的完整指南前言 一、Apache 连接保持 - 性

Linux中的more 和 less区别对比分析

《Linux中的more和less区别对比分析》在Linux/Unix系统中,more和less都是用于分页查看文本文件的命令,但less是more的增强版,功能更强大,:本文主要介绍Linu... 目录1. 基础功能对比2. 常用操作对比less 的操作3. 实际使用示例4. 为什么推荐 less?5.

spring-gateway filters添加自定义过滤器实现流程分析(可插拔)

《spring-gatewayfilters添加自定义过滤器实现流程分析(可插拔)》:本文主要介绍spring-gatewayfilters添加自定义过滤器实现流程分析(可插拔),本文通过实例图... 目录需求背景需求拆解设计流程及作用域逻辑处理代码逻辑需求背景公司要求,通过公司网络代理访问的请求需要做请

Java集成Onlyoffice的示例代码及场景分析

《Java集成Onlyoffice的示例代码及场景分析》:本文主要介绍Java集成Onlyoffice的示例代码及场景分析,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要... 需求场景:实现文档的在线编辑,团队协作总结:两个接口 + 前端页面 + 配置项接口1:一个接口,将o

IDEA下"File is read-only"可能原因分析及"找不到或无法加载主类"的问题

《IDEA下Fileisread-only可能原因分析及找不到或无法加载主类的问题》:本文主要介绍IDEA下Fileisread-only可能原因分析及找不到或无法加载主类的问题,具有很好的参... 目录1.File is read-only”可能原因2.“找不到或无法加载主类”问题的解决总结1.File