]> juplo.de Git - website/blob
79deff1d7670a61b3ad80d866123eec6e402ff81
[website] /
1 ---
2 _edit_last: "2"
3 categories:
4   - explained
5 date: "2016-03-08T00:29:46+00:00"
6 guid: http://juplo.de/?p=711
7 parent_post_id: null
8 post_id: "711"
9 tags:
10   - createmedia.nrw
11   - java
12   - maven
13 title: 'Release Of A Maven-Plugin to Maven Central Fails With "error: unknown tag: goal"'
14 url: /release-of-a-maven-plugin-to-maven-central-fails-with-error-unknown-tag-goal/
15
16 ---
17 ## error: unknown tag: goal
18
19 Releasing a maven-plugin via Maven Central does not work, if you have switched to Java 8.
20 This happens, because hidden in the `oss-parent`, that you have to configure as `parent` of your project to be able to release it via Sonatype, the `maven-javadoc-plugin` is configured for you.
21 And the version of `javadoc`, that is shipped with Java 8, by default checks the syntax of the comments and fails, if anything unexpected is seen.
22
23 **Unfortunatly, the special javadoc-tag's, like `@goal` or `@phase`, that are needed to configure the maven-plugin, are unexpected for javadoc.**
24
25 ## Solution 1: Turn Of The Linting Again
26
27 As described elswehere, you can easily [turn of the linting](http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html "Read, how to turn of the automatic linting of javadoc in Java 8") in the plugins-section of your `pom.xml`:
28
29 ```xml
30 <plugin>
31   <groupId>org.apache.maven.plugins</groupId>
32   <artifactId>maven-javadoc-plugin</artifactId>
33   <version>2.7</version>
34   <configuration>
35     <additionalparam>-Xdoclint:none</additionalparam>
36   </configuration>
37 </plugin>
38
39 ```
40
41 ## Solution 2: Tell javadoc About The Unknown Tags
42
43 Another not so well known approach, that I found in a [fix](https://github.com/julianhyde/hydromatic-resource/commit/da5b2f203402324c68dd2eb2e5ce628f722fefbb "Read the fix with the additional configuration for the unknown tags") for [an issue of some project](https://github.com/julianhyde/hydromatic-resource/issues/1 "See the issue, that lead me to the fix"), is, to add the unknown tag's in the configuration of the `maven-javadoc-plugin`:
44
45 ```xml
46 <plugin>
47   <groupId>org.apache.maven.plugins</groupId>
48   <artifactId>maven-javadoc-plugin</artifactId>
49   <version>2.7</version>
50   <configuration>
51     <tags>
52       <tag>
53         <name>goal</name>
54         <placement>a</placement>
55         <head>Goal:</head>
56       </tag>
57       <tag>
58         <name>phase</name>
59         <placement>a</placement>
60         <head>Phase:</head>
61       </tag>
62       <tag>
63         <name>threadSafe</name>
64         <placement>a</placement>
65         <head>Thread Safe:</head>
66       </tag>
67       <tag>
68         <name>requiresDependencyResolution</name>
69         <placement>a</placement>
70         <head>Requires Dependency Resolution:</head>
71       </tag>
72       <tag>
73         <name>requiresProject</name>
74         <placement>a</placement>
75         <head>Requires Project:</head>
76       </tag>
77     </tags>
78   </configuration>
79 </plugin>
80
81 ```