Skip to content

Commit 812410a

Browse files
committed
[MJAVADOC-765] Fix build with Java 20
1 parent 54e69eb commit 812410a

File tree

8 files changed

+46
-51
lines changed

8 files changed

+46
-51
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,7 @@ under the License.
492492
<plugin>
493493
<groupId>org.apache.maven.plugins</groupId>
494494
<artifactId>maven-invoker-plugin</artifactId>
495+
<version>3.6.0</version>
495496
<configuration>
496497
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
497498
<projectsDirectory>src/it/projects</projectsDirectory>

src/it/projects/MJAVADOC-538/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
<profiles>
5050
<profile>
51+
<id>java10+</id>
5152
<activation>
5253
<jdk>10</jdk>
5354
</activation>
Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
1-
package foo.bar;
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-
* App class
23-
*/
24-
public class MyClass
25-
{
26-
}
1+
package foo.bar;
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+
* App class
24+
*
25+
*/
26+
public class MyClass
27+
{
28+
/**
29+
* Constructor
30+
*/
31+
MyClass()
32+
{
33+
}
34+
}

src/it/projects/MJAVADOC-592_detectApiLink/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
<groupId>org.apache.maven.plugins.javadoc.it</groupId>
2626
<artifactId>mjavadoc592</artifactId>
2727
<version>1.0-SNAPSHOT</version>
28-
28+
2929
<url>https://issues.apache.org/jira/browse/MJAVADOC-592</url>
3030

3131
<properties>
3232
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
33-
<maven.compiler.source>7</maven.compiler.source>
34-
<maven.compiler.target>7</maven.compiler.target>
33+
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
34+
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
3535
</properties>
3636

3737
<build>

src/it/projects/MJAVADOC-592_detectApiLink/verify.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
19+
2020
def options = new File(basedir,'target/site/apidocs/options')
21-
assert options.readLines().dropWhile{it!='-linkoffline'}.get(1).startsWith("'https://docs.oracle.com/javase/7/docs/api'")
21+
assert options.readLines().dropWhile{it!='-linkoffline'}.get(1).startsWith("'https://docs.oracle.com/javase/8/docs/api")

src/it/projects/MJAVADOC-599/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535

3636
<properties>
3737
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
38-
<maven.compiler.source>1.8</maven.compiler.source>
39-
<maven.compiler.target>1.8</maven.compiler.target>
38+
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
39+
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
4040
</properties>
4141

4242
<build>

src/test/java/org/apache/maven/plugins/javadoc/FixJavadocMojoTest.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
3838
import org.apache.maven.plugins.javadoc.AbstractFixJavadocMojo.JavaEntityTags;
3939
import org.apache.maven.shared.invoker.MavenInvocationException;
40-
import org.codehaus.plexus.languages.java.version.JavaVersion;
4140
import org.codehaus.plexus.util.FileUtils;
4241
import org.codehaus.plexus.util.StringUtils;
4342

@@ -536,20 +535,6 @@ private void invokeCompileGoal(File testPom, File globalSettingsFile, Log log) t
536535

537536
Properties properties = new Properties();
538537

539-
if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("12")) {
540-
properties.put("maven.compiler.source", "1.7");
541-
properties.put("maven.compiler.target", "1.7");
542-
} else if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("9")) {
543-
properties.put("maven.compiler.source", "1.6");
544-
properties.put("maven.compiler.target", "1.6");
545-
}
546-
547-
// @todo unittests shouldn't need to go remote
548-
if (JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("8")) {
549-
// ensure that Java7 picks up TLSv1.2 when connecting with Central
550-
properties.put("https.protocols", "TLSv1.2");
551-
}
552-
553538
JavadocUtil.invokeMaven(
554539
log,
555540
new File(getBasedir(), "target/local-repo"),

src/test/resources/unit/fix-test/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
<version>1.1-SNAPSHOT</version>
2626
<name>Javadoc Test Project</name>
2727
<packaging>jar</packaging>
28-
28+
2929
<properties>
30-
<maven.compiler.source>1.5</maven.compiler.source>
31-
<maven.compiler.target>1.5</maven.compiler.target>
30+
<maven.compiler.source>8</maven.compiler.source>
31+
<maven.compiler.target>8</maven.compiler.target>
3232
</properties>
3333

3434
<build>

0 commit comments

Comments
 (0)