hive原始碼編譯(失敗記錄)

Applied Sciences發表於2020-12-20

編譯hive 原始碼的命令:

mvn clean install -T 4C -DskinpTests
出現如下報錯:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project metastore-tools-common: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile failed: 
Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.1 or one of its dependencies could not be resolved:
Could not transfer artifact com.google.errorprone:javac:jar:9+181-r4173-1 from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): Authorization failed for http://maven.aliyun.com/nexus/content/repositories/central/com/google/errorprone/javac/9+181-r4173-1/javac-9+181-r4173-1.jar 403 Forbidden -> [Help 1]

###############################################################################################
整個意思是javac-9+181-r4173-1.jar因為阿里雲的maven倉庫的403許可權問題無法下載
下面開始排查com.google.errorprone是哪個pom.xml寫入的依賴需求

在maven上找到了這麼個連結:
https://mvnrepository.com/artifact/com.google.errorprone/javac/9+181-r4173-1
對應的pom是:
<dependency>
    <groupId>com.google.errorprone</groupId>
    <artifactId>javac</artifactId>
    <version>9+181-r4173-1</version>
</dependency>

那麼也就是說hive的原始碼資料夾中存在上述pom遇到了403報錯導致編譯失敗了.

查詢作妖的具體是哪個pom,查詢過程如下 :
(Python3.6) appleyuchi@Desktop:~/桌面/hive$ **grep -r com.google.errorprone\<**
①standalone-metastore/metastore-tools/metastore-benchmarks/pom.xml:            <groupId>com.google.errorprone</groupId>
②standalone-metastore/metastore-tools/tools-common/pom.xml:            <groupId>com.google.errorprone</groupId>

也就是說,$HIVE_HOME/pom.xml中的standalone-metastore這個module出了編譯故障.

###############################################################################################

先去這個pom.xml裡面註釋掉其他的只留下下面兩個,

    <module>upgrade-acid</module>
    <module>kafka-handler</module>

因為這兩個由於standalone-metastore的故障導致沒有進行編譯,我們來編譯檢查下是否會出現問題.

執行之後看了下沒啥問題.

也就是說這個hive的編譯只剩下standalone-metastore這個模組了.

####################################################################################################

$HIVE_HOME/pom.xml只留下standalone-metastore

然後①②兩個pom.xml的com.google.errorprone的

</dependency>前面加入:

<scope>system</scope>
<systemPath>/home/appleyuchi/桌面/javac-9+181-r4173-1.jar</systemPath>

 

像下面這樣

          <dependency>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_core</artifactId>
            <version>${errorprone.core.version}</version>
            <scope>system</scope>
                <systemPath>/home/appleyuchi/桌面/javac-9+181-r4173-1.jar</systemPath>
          </dependency>

###############################################################################################

 

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project metastore-tools-common: Fatal error compiling: CompilerException: InvocationTargetException: com/google/errorprone/ErrorProneCompiler$Builder: com.google.errorprone.ErrorProneCompiler$Builder -> [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

 

搞不定,醉了.....
 

 

 

 

相關文章