I’m trying to run griddb from the source code. When I navigate to java_client and execute mvn clean install, I get this error: Failed to execute goal org.apache.maven.plugins: maven-compiler-plugin. Source Option 5 is no longer supported. Use 6 or later. Target option 1.5 is no longer supported. Use 1.6 or Later.
I tried editing the pom.xml to explicitly use source & target 1.8 but it didn’t work.
I also made sure I have a recent & stable version of JDK installed (11.0.26).
I’m using Ubuntu 20.04.4 LTS
This is my current pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://w3.org/2001/XMLSchema-instance…"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd…">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.griddb</groupId>
<artifactId>gridstore</artifactId>
<version>5.7.0</version>
<packaging>jar</packaging>
<name>com.github.griddb:java_client</name>
<description>Java Client for GridDB CE</description>
<url>https://github.com/griddb/griddb/tree/master/java_client…</url>
<scm>
<connection>scm:git:https://github.com/griddb/griddb.git…</connection>
<url>https://github.com/griddb/griddb</url>
<tag>HEAD</tag>
</scm>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://apache.org/licenses/LICENSE-2.0.txt…</url>
</license>
</licenses>
<developers>
<developer>
<name>Katsuhiko Nonomura</name>
<email>contact@griddb.org</email>
<url />
<organization>Toshiba Digital Solutions Corporation</organization>
<organizationUrl />
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.7</version>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots…</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/…</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<source>1.8</source>
<target>1.8</target>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<updateReleaseInfo>true</updateReleaseInfo>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
<keyname>C3967694EBAB9CF32772ADB95C4A184E06E8885B</keyname>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<inherited>true</inherited>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
</plugins>
</build>
</project>
This is the output of mvn help:effective-pom: I believe it’s still using source 1.5 but I’m not sure why / how to change it.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://w3.org/2001/XMLSchema-instance…"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd…">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.griddb</groupId>
<artifactId>gridstore</artifactId>
<version>5.7.0</version>
<packaging>jar</packaging>
<name>com.github.griddb:java_client</name>
<description>Java Client for GridDB CE</description>
<url>https://github.com/griddb/griddb/tree/master/java_client…</url>
<scm>
<connection>scm:git:https://github.com/griddb/griddb.git…</connection>
<url>https://github.com/griddb/griddb</url>
<tag>HEAD</tag>
</scm>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://apache.org/licenses/LICENSE-2.0.txt…</url>
</license>
</licenses>
<developers>
<developer>
<name>Katsuhiko Nonomura</name>
<email>contact@griddb.org</email>
<url />
<organization>Toshiba Digital Solutions Corporation</organization>
<organizationUrl />
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
<version>1.7.7</version>
</dependency>
</dependencies>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots…</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/…</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<updateReleaseInfo>true</updateReleaseInfo>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<inherited>true</inherited>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<updateReleaseInfo>true</updateReleaseInfo>
</configuration>
</plugin>
</plugins>
</build>
</project>
I think you have configured the wrong maven plugin. What you need is a setting for the compiler plugin. The easiest would be to add this:
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>