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

相关文章

python panda库从基础到高级操作分析

《pythonpanda库从基础到高级操作分析》本文介绍了Pandas库的核心功能,包括处理结构化数据的Series和DataFrame数据结构,数据读取、清洗、分组聚合、合并、时间序列分析及大数据... 目录1. Pandas 概述2. 基本操作:数据读取与查看3. 索引操作:精准定位数据4. Group

MySQL中EXISTS与IN用法使用与对比分析

《MySQL中EXISTS与IN用法使用与对比分析》在MySQL中,EXISTS和IN都用于子查询中根据另一个查询的结果来过滤主查询的记录,本文将基于工作原理、效率和应用场景进行全面对比... 目录一、基本用法详解1. IN 运算符2. EXISTS 运算符二、EXISTS 与 IN 的选择策略三、性能对比

MySQL 内存使用率常用分析语句

《MySQL内存使用率常用分析语句》用户整理了MySQL内存占用过高的分析方法,涵盖操作系统层确认及数据库层bufferpool、内存模块差值、线程状态、performance_schema性能数据... 目录一、 OS层二、 DB层1. 全局情况2. 内存占js用详情最近连续遇到mysql内存占用过高导致

深度解析Nginx日志分析与499状态码问题解决

《深度解析Nginx日志分析与499状态码问题解决》在Web服务器运维和性能优化过程中,Nginx日志是排查问题的重要依据,本文将围绕Nginx日志分析、499状态码的成因、排查方法及解决方案展开讨论... 目录前言1. Nginx日志基础1.1 Nginx日志存放位置1.2 Nginx日志格式2. 499

Olingo分析和实践之EDM 辅助序列化器详解(最佳实践)

《Olingo分析和实践之EDM辅助序列化器详解(最佳实践)》EDM辅助序列化器是ApacheOlingoOData框架中无需完整EDM模型的智能序列化工具,通过运行时类型推断实现灵活数据转换,适用... 目录概念与定义什么是 EDM 辅助序列化器?核心概念设计目标核心特点1. EDM 信息可选2. 智能类

Olingo分析和实践之OData框架核心组件初始化(关键步骤)

《Olingo分析和实践之OData框架核心组件初始化(关键步骤)》ODataSpringBootService通过初始化OData实例和服务元数据,构建框架核心能力与数据模型结构,实现序列化、URI... 目录概述第一步:OData实例创建1.1 OData.newInstance() 详细分析1.1.1

Olingo分析和实践之ODataImpl详细分析(重要方法详解)

《Olingo分析和实践之ODataImpl详细分析(重要方法详解)》ODataImpl.java是ApacheOlingoOData框架的核心工厂类,负责创建序列化器、反序列化器和处理器等组件,... 目录概述主要职责类结构与继承关系核心功能分析1. 序列化器管理2. 反序列化器管理3. 处理器管理重要方

SpringBoot中六种批量更新Mysql的方式效率对比分析

《SpringBoot中六种批量更新Mysql的方式效率对比分析》文章比较了MySQL大数据量批量更新的多种方法,指出REPLACEINTO和ONDUPLICATEKEY效率最高但存在数据风险,MyB... 目录效率比较测试结构数据库初始化测试数据批量修改方案第一种 for第二种 case when第三种

解决1093 - You can‘t specify target table报错问题及原因分析

《解决1093-Youcan‘tspecifytargettable报错问题及原因分析》MySQL1093错误因UPDATE/DELETE语句的FROM子句直接引用目标表或嵌套子查询导致,... 目录报js错原因分析具体原因解决办法方法一:使用临时表方法二:使用JOIN方法三:使用EXISTS示例总结报错原

MySQL中的LENGTH()函数用法详解与实例分析

《MySQL中的LENGTH()函数用法详解与实例分析》MySQLLENGTH()函数用于计算字符串的字节长度,区别于CHAR_LENGTH()的字符长度,适用于多字节字符集(如UTF-8)的数据验证... 目录1. LENGTH()函数的基本语法2. LENGTH()函数的返回值2.1 示例1:计算字符串