文章目录
- 搭建OpenLooKeng开发环境
- 要求
 
- 以下是搭建OpenLooKeng开发环境的基本步骤:
- 1、从OpenLooKeng的GitHub仓库克隆代码:
- 2、 构建OpenLooKeng
- 生成IntelliJ IDEA项目文件
 
- airbase
- 构建项目过程中出现的问题
- checkstyle错误
- 版本冲突问题hetu-heuristic-index: Some Enforcer rules have failed
 
搭建OpenLooKeng开发环境
在搭建OpenLooKeng开发环境之前,需要确保你的机器上安装了Java Development Kit (JDK) 8以上版本,因为OpenLooKeng是用Java编写的。
要求
Mac OS X或Linux
 Java 8 Update 161或更高版本(8u161+)(64位)。同时支持Oracle JDK和OpenJDK。
 AArch64 (Bisheng JDK 1.8.262 或更高版本)
 Maven 3.3.9+(用于构建)
 Python 2.4+(与启动器脚本一起运行)
以下是搭建OpenLooKeng开发环境的基本步骤:
1、从OpenLooKeng的GitHub仓库克隆代码:
git clone https://github.com/openlookeng/openlookeng.git
进入代码目录:
cd openlookeng
确保安装了Maven,用于构建项目:
2、 构建OpenLooKeng
构建OpenLooKeng:
mvn clean install -DskipTests
如果你想要开发或修改OpenLooKeng的代码,你可能需要配置IDE以便于开发,例如使用IntelliJ IDEA:
生成IntelliJ IDEA项目文件
mvn idea:idea
然后用IntelliJ IDEA打开项目。
 
这些步骤提供了一个基本的开发环境,你可以在此基础上进行代码的开发和测试。具体的开发活动,比如修改代码、添加功能等,需要根据项目具体情况和开发文档来执行。
airbase
<parent>  
    <groupId>io.airlift</groupId>  
    <artifactId>airbase</artifactId>  
    <version>97</version>  
</parent>
openLooKeng 项目继承自 io.airlift 组织的 airbase 项目,版本为 97。airbase 是 Airlift 公司提供的一个基础构建工具集,它包含了一系列 Maven 插件、依赖管理和其他配置,旨在帮助 Java 开发者更容易地创建、维护和发布 Maven 项目。
通过在项目中包含这个 元素,openLooKeng将继承 airbase POM 中定义的所有配置。这通常包括编译设置、依赖管理、插件配置等。这有助于确保您的项目遵循 Airlift 的最佳实践,并与其他使用 airbase 的项目保持一致性。
当您构建或安装您的 Maven 项目时,Maven 会首先解析父 POM,并将父 POM 中的配置应用到当前项目中。这样,您就可以专注于您项目的特定配置,而不必重复设置那些已经在父 POM 中定义好的通用配置。故openLooKeng很多默认配置都是继承自airbase 。
 airbase 将maven检查分为两组:基本组和扩展组
| Group | Check | Skip check (Setting to true skips the check) | Fail build (Setting to false only reports a warning) | 
|---|---|---|---|
| Basic | Maven Enforcer | air.check.skip-enforcer | air.check.fail-enforcer | 
| Basic | Maven Dependencies | air.check.skip-dependency | air.check.fail-dependency | 
| Basic | Maven Duplicate finder | air.check.skip-duplicate-finder | air.check.fail-duplicate-finder | 
| Basic | Maven Dependency scope | air.check.skip-dependency-scope | air.check.fail-dependency-scope | 
| Extended | SpotBugs | air.check.skip-spotbugs | air.check.fail-spotbugs | 
| Extended | PMD | air.check.skip-pmd | air.check.fail-pmd | 
| Extended | License check | air.check.skip-license | air.check.fail-license | 
| Extended | Code coverage | air.check.skip-jacoco | air.check.fail-jacoco | 
| Extended | Modernizer | air.check.skip-modernizer | air.check.fail-modernizer | 
| Extended | Checkstyle | air.check.skip-checkstyle | air.check.fail-checkstyle | 
构建项目过程中出现的问题
构建项目过程中的问题大部分与airbase 的配置相关
checkstyle错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.1.0:check (checkstyle) on project presto-array: You have 2 Checkstyle violations. -> [Help 1]
 [ERROR]
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR]
 [ERROR] For more information about the errors and possible solutions, please read the following articles:
 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
 [ERROR]
 [ERROR] After correcting the problems, you can resume the build with the command
 [ERROR] mvn -rf :presto-array
解决办法:
 在根 pom.xml增加<air.check.skip-checkstyle>true</air.check.skip-checkstyle> 忽略checkstyle问题
    <properties>
        <air.main.basedir>${project.basedir}</air.main.basedir>
        <air.check.skip-spotbugs>true</air.check.skip-spotbugs>
        <air.check.skip-pmd>true</air.check.skip-pmd>
        <air.check.skip-jacoco>true</air.check.skip-jacoco>
        <air.check.skip-checkstyle>true</air.check.skip-checkstyle>
        .......
    </properties>
版本冲突问题hetu-heuristic-index: Some Enforcer rules have failed
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (default) on project hetu-heuristic-index: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
 [ERROR]
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR]
 [ERROR] For more information about the errors and possible solutions, please read the following articles:
 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
 [ERROR]
 [ERROR] After correcting the problems, you can resume the build with the command
 [ERROR] mvn -rf :hetu-heuristic-index
解决办法:
在根 pom.xml增加<air.check.skip-enforcer>true</air.check.skip-enforcer>
    <properties>
        <air.main.basedir>${project.basedir}</air.main.basedir>
        <air.check.skip-spotbugs>true</air.check.skip-spotbugs>
        <air.check.skip-pmd>true</air.check.skip-pmd>
        <air.check.skip-jacoco>true</air.check.skip-jacoco>
        <air.check.skip-checkstyle>true</air.check.skip-checkstyle>
        <air.check.skip-enforcer>true</air.check.skip-enforcer>
        ....................
   </properties>



















