This message was deleted.
# general
s
This message was deleted.
h
Running
mvn compile
resulted in an error still:
Copy code
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project buildtools: Compilation failure
[ERROR] /Users/user.name/Projects/pulsar/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java:[30,18] cannot access org.testng.ITestResult
[ERROR]   bad class file: /Users/user.name/.m2/repository/org/testng/testng/7.7.0/testng-7.7.0.jar(org/testng/ITestResult.class)
[ERROR]     class file has wrong version 55.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.
The
requireMavenVersion
is set to
3.6.1
I see in the
pom.xml
. My local Maven is
3.8.6
. That is still compliant isn't it?
Copy code
➜ mvn -v
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /Applications/apache-maven-3.8.6
Java version: 1.8.0_322, vendor: <http://Amazon.com|Amazon.com> Inc., runtime: /Library/Java/JavaVirtualMachines/amazon-corretto-8.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "13.1", arch: "x86_64", family: "mac"
d
Try using the core modules profile in the build command
l
Here's the command:
Copy code
mvn -Pcore-modules,-main clean install -DskipTests -Dspotbugs.skip=true
Copy code
class file has wrong version 55.0, should be 52.0
You must use Java 17 for compiling the master branch version of Pulsar (requirements).
h
I see. I have Java 17 set in IntelliJ but not by default for the command line. That may be the problem. It may have compiled within IntelliJ.
My original problem looks like the
core-modules
.
@Lari Hotari From the command line I switched my sdk to
java 17.0.5-tem
After running your given command I'm getting the error:
Copy code
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project buildtools: Compilation failure
[ERROR] /Users/brandon.hoffman/Projects/pulsar/buildtools/src/main/java/org/apache/pulsar/tests/RetryAnalyzer.java:[30,18] cannot access org.testng.ITestResult
[ERROR]   bad class file: /Users/brandon.hoffman/.m2/repository/org/testng/testng/7.7.0/testng-7.7.0.jar(org/testng/ITestResult.class)
[ERROR]     class file has wrong version 55.0, should be 52.0
[ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.
l
Please verify with
mvn -v
that Java 17 is in use.
h
Yep that was the problem. Had to do some re-jiggering with sdkman Got it to build now
🎉 1
[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 41:34 min [INFO] Finished at: 2023-01-10T122416-08:00 [INFO] ------------------------------------------------------------------------