问题
has anyone come across a simlar maven error below?
i am unable to build my project due to the error below. All was working previously fine before i started working on the code.
I did not even work on the below defined interfaces and it seems to be related to javadoc?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar (attach-javadocs) on project jonney-project: MavenReportException: Error while creating archive:
[ERROR] Exit code: 1 - /Users/me/Work/myProject/library/src/main/java/com/me/someInterface.java:45: warning: no @return
[ERROR] public abstract boolean searchForDevce();
[ERROR] ^
[ERROR] /Users/me/Work/myProject/src/main/java/com/me/someInterfaceAgain.java:52: warning: no @return
[ERROR] public abstract boolean selectDevice(int pos);
[ERROR] ^
回答1:
I'm guessing you switched to Java 8. In this version Javadoc is stricter on the requirements.
You have three choices:
- Fix the errors
- disable the strict checking
- skip Javadoc when building
To disable the strict checking, add this to your pom.xml
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
to skip Javadoc while building, use this:
mvn -Dmaven.javadoc.skip=true verify
Further Information
回答2:
With maven-javadoc-plugin version 3.0.0 <additionalparam/>
has been replaced by <additionalOptions/>
. To reduce the errors to warnings this pom.xml entry worked for me:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<additionalOptions>
<additionalOption>-Xdoclint:none</additionalOption>
</additionalOptions>
</configuration>
</plugin>
</plugins>
</build>
回答3:
Just update your pom.xml with the properties tag, given below.
<properties>
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
来源:https://stackoverflow.com/questions/23542876/unable-to-build-maven-project-due-to-javadoc-error