Skip to content

Commit 5697975

Browse files
committed
[MJAVADOC-591] javadoc fails with maven.compiler.release=8 and Automatic-Module-Name
1 parent d80cb08 commit 5697975

File tree

4 files changed

+118
-1
lines changed

4 files changed

+118
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
invoker.java.version = 9+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<!--
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
-->
21+
22+
<project xmlns="http://maven.apache.org/POM/4.0.0"
23+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
24+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
25+
<modelVersion>4.0.0</modelVersion>
26+
27+
<groupId>testcase</groupId>
28+
<artifactId>javadoc-fails-with-release-and-not-source</artifactId>
29+
<version>1.0-SNAPSHOT</version>
30+
<packaging>bundle</packaging>
31+
32+
<url>https://issues.apache.org/jira/browse/MJAVADOC-591</url>
33+
34+
<properties>
35+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36+
<maven.compiler.release>8</maven.compiler.release>
37+
</properties>
38+
39+
<build>
40+
<plugins>
41+
<plugin>
42+
<groupId>org.apache.felix</groupId>
43+
<artifactId>maven-bundle-plugin</artifactId>
44+
<version>4.1.0</version>
45+
<extensions>true</extensions>
46+
<configuration>
47+
<instructions>
48+
<Automatic-Module-Name>com.example.testcase</Automatic-Module-Name>
49+
</instructions>
50+
</configuration>
51+
</plugin>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-javadoc-plugin</artifactId>
55+
<version>@project.version@</version>
56+
<executions>
57+
<execution>
58+
<id>attach-javadocs</id>
59+
<goals>
60+
<goal>jar</goal>
61+
</goals>
62+
</execution>
63+
</executions>
64+
</plugin>
65+
</plugins>
66+
</build>
67+
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.example;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
/**
23+
* This is a Foo.
24+
*/
25+
public interface Foo
26+
{
27+
/**
28+
* Frobnicates the foo.
29+
*/
30+
public void frobnicate();
31+
}

src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4933,7 +4933,8 @@ private void addJavadocOptions( File javadocOutputDirectory,
49334933
Map<String, JavaModuleDescriptor> allModuleDescriptors = new HashMap<>();
49344934

49354935
boolean supportModulePath = javadocRuntimeVersion.isAtLeast( "9" )
4936-
&& ( source == null || JavaVersion.parse( source ).isAtLeast( "9" ) );
4936+
&& ( source == null || JavaVersion.parse( source ).isAtLeast( "9" ) )
4937+
&& ( release == null || JavaVersion.parse( release ).isAtLeast( "9" ) );
49374938

49384939
if ( supportModulePath )
49394940
{

0 commit comments

Comments
 (0)