近来想看看p8有什么新功能,是否能大幅提高性能,因此下载代码进行编译及运行,特此记录:
下载源码:https://github.com/pentaho/pentaho-platform/tree/8.1
系统:ubuntu14.4 JDK:1.8 Maven:apache-maven-3.3.9
解压源码至:/opt/pentaho-platform-8.1
执行编译命令:mvn clean install
1.出错:Non-resolvable parent POM for pentaho
解决:注释根目录下POM文件中<parent></parent>节点的内容
<!--<parent>
<groupId>org.pentaho</groupId>
<artifactId>pentaho-ce-jar-parent-pom</artifactId>
<version>8.1.0.0-SNAPSHOT</version>
</parent>-->
2.继续,一堆错,修改如下:
在pentaho-platform-8.1/build-utils/pom.xml文件中,修改JDK版本和路径
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>/usr/lib/jvm/jdk1.8.0_112/lib/tools.jar</systemPath>
</dependency>
修改maven-javadoc-plugin的版本,我改为3.0.0
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
另外编译生成Javadoc时有部分代码会报错,因此干脆设置跳过Javadoc
<encoding>UTF-8</encoding>
<skip>true</skip>
<verbose>false</verbose>
<show>public</show>
3. pentaho-platform-8.1/extensions/pom.xml 添加jackson版本
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.9.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.4</version>
</dependency>
4.证书出错: sun.security.validator.ValidatorException: PKIX path building failed:
下载InstallCert.java,执行 java InstallCert repo.maven.apache.org,java InstallCert nexus.pentaho.org 将生成的jssecacerts文件拷贝到jre目录
/usr/lib/jvm/jdk1.8.0_112/jre/lib/security下
5.执行mvn clean install -DskipTests 编译命令 ,跳过test
6.找不到源码包错,pentaho资源库中源码包被加入时间戳,因此下载pentaho-platform-extensions-8.1.0.0-sources.jar源码包后放入本地路径需要修改:
/opt/pentaho-platform-8.1/user-console/pom.xml
<dependency>
<groupId>pentaho</groupId>
<artifactId>pentaho-platform-extensions</artifactId>
<version>${project.version}</version>
<scope>system</scope>
<systemPath>/root/.m2/repository/pentaho/pentaho-platform-extensions/8.1.0.0-SNAPSHOT/pentaho-platform-extensions-8.1.0.0-sources.jar</systemPath>
<classifier>sources</classifier>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
添加Maven版本
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>gwt</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>gwt</classifier>
<classesDirectory>${gwt.outputDirectory}</classesDirectory>
</configuration>
</execution>
</executions>
</plugin>
7.恢复第一步修改的<parent></parent>节点的内容继续编译
8.编译成功,花了4个小时。