Skip to content

Commit

Permalink
Fix build with Java 20
Browse files Browse the repository at this point in the history
  • Loading branch information
slachiewicz committed Aug 14, 2023
1 parent 54e69eb commit a76fac0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 23 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ under the License.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<projectsDirectory>src/it/projects</projectsDirectory>
Expand Down
6 changes: 3 additions & 3 deletions src/it/projects/MJAVADOC-592_detectApiLink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
<groupId>org.apache.maven.plugins.javadoc.it</groupId>
<artifactId>mjavadoc592</artifactId>
<version>1.0-SNAPSHOT</version>

<url>https://issues.apache.org/jira/browse/MJAVADOC-592</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>7</maven.compiler.source>
<maven.compiler.target>7</maven.compiler.target>
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
</properties>

<build>
Expand Down
4 changes: 2 additions & 2 deletions src/it/projects/MJAVADOC-599/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>@maven.compiler.source@</maven.compiler.source>
<maven.compiler.target>@maven.compiler.target@</maven.compiler.target>
</properties>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
import org.apache.maven.plugins.javadoc.AbstractFixJavadocMojo.JavaEntityTags;
import org.apache.maven.shared.invoker.MavenInvocationException;
import org.codehaus.plexus.languages.java.version.JavaVersion;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;

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

Properties properties = new Properties();

if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("12")) {
properties.put("maven.compiler.source", "1.7");
properties.put("maven.compiler.target", "1.7");
} else if (JavaVersion.JAVA_SPECIFICATION_VERSION.isAtLeast("9")) {
properties.put("maven.compiler.source", "1.6");
properties.put("maven.compiler.target", "1.6");
}

// @todo unittests shouldn't need to go remote
if (JavaVersion.JAVA_SPECIFICATION_VERSION.isBefore("8")) {
// ensure that Java7 picks up TLSv1.2 when connecting with Central
properties.put("https.protocols", "TLSv1.2");
}

JavadocUtil.invokeMaven(
log,
new File(getBasedir(), "target/local-repo"),
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/unit/fix-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<version>1.1-SNAPSHOT</version>
<name>Javadoc Test Project</name>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>1.5</maven.compiler.source>
<maven.compiler.target>1.5</maven.compiler.target>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>

<build>
Expand Down

0 comments on commit a76fac0

Please sign in to comment.