Unable to find javadoc command: The environment variable JAVA_HOME is not set

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project inter-core: MavenReportException: Error while creating archive: Unable to find javadoc command: The environment variable JAVA_HOME is not correctly set.



 

需要添加配置如:

<configuration>
					<javadocExecutable>/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/javadoc</javadocExecutable>
				</configuration>

最后修改如下:

<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9.1</version>
				<configuration>
					<javadocExecutable>/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/javadoc</javadocExecutable>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

 参考地址:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206880855-MavenReportException-Error-while-creating-archive-Unable-to-find-javadoc-command-The-environment-variable-JAVA-HOME-is-not-correctly-set-

猜你喜欢

转载自yeshuang.iteye.com/blog/2323630