天天看点

Presto 0.227版本源码编译

1. 环境准备

(1)Win10

(2)JDK(要求1.8.151及以上)

(3)Maven(要求3.3.9及以上)

2. 问题出现的原因及解决方法

(1)Error: java: RegexpMultiline: Line contains carriage return

原因:Presto会对代码规范进行严格的检查,maven-checkstyle-plugin检查失败就会报错

解决方法:在presto-root模块的pom.xml中properties部分添加以下内容:

<air.check.skip-extended>true</air.check.skip-extended>

并且注释掉

<air.checkstyle.config-file>src/checkstyle/presto-checks.xml</air.checkstyle.config-file>

(2)Failed to execute goal io.takari.maven.plugins:presto-maven-plugin:0.1.12:generate-service-descriptor (default-generate-service-descriptor) on project presto-jmx: Execution default-generate-service-descriptor of goal io.takari.maven.plugins:presto-maven-plugin:0.1.12:generate-service-descriptor

原因:Presto Github上说明了它支持Linux / Mac 编译,在Windows上编译需要去掉一部分内容

解决方法:在presto-docs模块中注释掉以下内容:

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>validate-reserved</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>java</goal>
                        </goals>
                        <configuration>
                            <mainClass>com.facebook.presto.sql.ReservedIdentifiers</mainClass>
                            <arguments>
                                <argument>validateDocs</argument>
                                <argument>${project.basedir}/src/main/sphinx/language/reserved.rst</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>validate-thrift-idl</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>diff</executable>
                            <arguments>
                                <argument>-b</argument>
                                <argument>-c</argument>
                                <argument>${project.basedir}/src/main/sphinx/include/PrestoThriftService.thrift</argument>
                                <argument>${project.build.directory}/PrestoThriftService.thrift</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <includeProjectDependencies>false</includeProjectDependencies>
                    <includePluginDependencies>true</includePluginDependencies>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>com.facebook.presto</groupId>
                        <artifactId>presto-parser</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
           

(3)IDEA报错Could not reserve enough space for xxxxKB object heap

原因:IDEA堆内存分配不够

解决方法:打开IDEA安装目录下bin中的idea.exe.vmoptions和idea64.exe.vmoptions,修改Xmx和Xms为1024m

继续阅读