Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

按照 Quick Start 操作,编译流程不通过 #1

Closed
Aarebecca opened this issue Jun 12, 2023 · 4 comments
Closed

按照 Quick Start 操作,编译流程不通过 #1

Aarebecca opened this issue Jun 12, 2023 · 4 comments

Comments

@Aarebecca
Copy link
Contributor

按照 Quick Start 操作,执行

mvn clean package -DskipTests

后报错:
image

环境:
Java: 1.8.0_202
Maven: 3.9.2

@pengzhiwei2018
Copy link

看上去是Java环境的问题,确认JDK是否正确安装,另外,JAVA_HOME环境变量也要配置一下.

@Leomrlin
Copy link
Collaborator

Leomrlin commented Jun 12, 2023

确认下JDK和MAVEN是否正确安装
java -version
javac -version
mvn -v
echo $JAVA_HOME

@Aarebecca
Copy link
Contributor Author

Aarebecca commented Jun 12, 2023

排查后发现是 mvn 使用了系统默认的 JDK,在 .zshrc 中配置 JAVA_HOME 为实际安装JDK路径

如:
image

后续问题记录:

  • 再次尝试编译,提示 Unable to find javadoc command
image

在根目录下 pom.xml 文件中配置 maven-javadoc-plugin
添加 <javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>⚠️ JDK 11 为: ${java.home}/bin/javadoc
image

  • 尝试编译,提示 Could not resolve dependencies for project com.antgroup.tugraph
image

原因是使用 maven 的官方源网速较慢,建议使用阿里云或者清华提供的源。
配置方式:

  • 编辑 maven 根目录/conf/settings.xml 文件,在 mirrors 下添加源
<mirror>
    <id>alimaven</id>
    <mirrorOf>central</mirrorOf>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>

其他源参考:https://blog.csdn.net/qq_38217990/article/details/129257106

构建时间较长,可能长达 30 分钟。提示以下内容后,即构建成功
image

@Leomrlin
Copy link
Collaborator

感谢详细的记录,首次编译可能会比较慢,后面在指引文档里添加maven更换国内源的tips,并引导确认下jdk和maven是否正确安装,再次感谢你的建议!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants