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

相关文章

Springboot中分析SQL性能的两种方式详解

《Springboot中分析SQL性能的两种方式详解》文章介绍了SQL性能分析的两种方式:MyBatis-Plus性能分析插件和p6spy框架,MyBatis-Plus插件配置简单,适用于开发和测试环... 目录SQL性能分析的两种方式:功能介绍实现方式:实现步骤:SQL性能分析的两种方式:功能介绍记录

最长公共子序列问题的深度分析与Java实现方式

《最长公共子序列问题的深度分析与Java实现方式》本文详细介绍了最长公共子序列(LCS)问题,包括其概念、暴力解法、动态规划解法,并提供了Java代码实现,暴力解法虽然简单,但在大数据处理中效率较低,... 目录最长公共子序列问题概述问题理解与示例分析暴力解法思路与示例代码动态规划解法DP 表的构建与意义动

C#使用DeepSeek API实现自然语言处理,文本分类和情感分析

《C#使用DeepSeekAPI实现自然语言处理,文本分类和情感分析》在C#中使用DeepSeekAPI可以实现多种功能,例如自然语言处理、文本分类、情感分析等,本文主要为大家介绍了具体实现步骤,... 目录准备工作文本生成文本分类问答系统代码生成翻译功能文本摘要文本校对图像描述生成总结在C#中使用Deep

Redis主从/哨兵机制原理分析

《Redis主从/哨兵机制原理分析》本文介绍了Redis的主从复制和哨兵机制,主从复制实现了数据的热备份和负载均衡,而哨兵机制可以监控Redis集群,实现自动故障转移,哨兵机制通过监控、下线、选举和故... 目录一、主从复制1.1 什么是主从复制1.2 主从复制的作用1.3 主从复制原理1.3.1 全量复制

Redis主从复制的原理分析

《Redis主从复制的原理分析》Redis主从复制通过将数据镜像到多个从节点,实现高可用性和扩展性,主从复制包括初次全量同步和增量同步两个阶段,为优化复制性能,可以采用AOF持久化、调整复制超时时间、... 目录Redis主从复制的原理主从复制概述配置主从复制数据同步过程复制一致性与延迟故障转移机制监控与维

Redis连接失败:客户端IP不在白名单中的问题分析与解决方案

《Redis连接失败:客户端IP不在白名单中的问题分析与解决方案》在现代分布式系统中,Redis作为一种高性能的内存数据库,被广泛应用于缓存、消息队列、会话存储等场景,然而,在实际使用过程中,我们可能... 目录一、问题背景二、错误分析1. 错误信息解读2. 根本原因三、解决方案1. 将客户端IP添加到Re

Redis主从复制实现原理分析

《Redis主从复制实现原理分析》Redis主从复制通过Sync和CommandPropagate阶段实现数据同步,2.8版本后引入Psync指令,根据复制偏移量进行全量或部分同步,优化了数据传输效率... 目录Redis主DodMIK从复制实现原理实现原理Psync: 2.8版本后总结Redis主从复制实

锐捷和腾达哪个好? 两个品牌路由器对比分析

《锐捷和腾达哪个好?两个品牌路由器对比分析》在选择路由器时,Tenda和锐捷都是备受关注的品牌,各自有独特的产品特点和市场定位,选择哪个品牌的路由器更合适,实际上取决于你的具体需求和使用场景,我们从... 在选购路由器时,锐捷和腾达都是市场上备受关注的品牌,但它们的定位和特点却有所不同。锐捷更偏向企业级和专

Spring中Bean有关NullPointerException异常的原因分析

《Spring中Bean有关NullPointerException异常的原因分析》在Spring中使用@Autowired注解注入的bean不能在静态上下文中访问,否则会导致NullPointerE... 目录Spring中Bean有关NullPointerException异常的原因问题描述解决方案总结

python中的与时间相关的模块应用场景分析

《python中的与时间相关的模块应用场景分析》本文介绍了Python中与时间相关的几个重要模块:`time`、`datetime`、`calendar`、`timeit`、`pytz`和`dateu... 目录1. time 模块2. datetime 模块3. calendar 模块4. timeit