Waikato / moa

MOA is an open source framework for Big Data stream mining. It includes a collection of machine learning algorithms (classification, regression, clustering, outlier detection, concept drift detection and recommender systems) and tools for evaluation.
http://moa.cms.waikato.ac.nz/
GNU General Public License v3.0
603 stars 352 forks source link

MOA devel docker image fails to build with Java 8 #275

Open nuwangunasekara opened 1 year ago

nuwangunasekara commented 1 year ago

MOA docker image fail to build with Java 8.

docker/devel-gui.Dockerfile:

      openjdk-8-jdk \

where meka-1.9.7.jar is build with version 55.0 (Java SE 11)

jar xf meka-1.9.7.jar
cd meka
find ./ -name 'Metrics.class'
.//core/Metrics.class

file .//core/Metrics.class                  
.//core/Metrics.class: compiled Java class data, version 55.0 (Java SE 11)

Hence, the build inside the docker devel image fails with below error (full log):

#10 54.78 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.8.1:jar (attach-javadocs) on project moa: MavenReportException: Error while creating archive: 
#10 54.78 [ERROR] Exit code: 1 - /app/moa/moa/src/main/java/moa/classifiers/multilabel/meta/OzaBagAdwinML.java:34: error: cannot access Metrics
#10 54.78 [ERROR] import meka.core.Metrics;
#10 54.78 [ERROR]                 ^
#10 54.78 [ERROR]   bad class file: /root/.m2/repository/net/sf/meka/meka/1.9.7/meka-1.9.7.jar(meka/core/Metrics.class)
#10 54.78 [ERROR]     class file has wrong version 55.0, should be 52.0
#10 54.78 [ERROR]     Please remove or make sure it appears in the correct subdirectory of the classpath.
#10 54.78 [ERROR] 
#10 54.78 [ERROR] Command line was: /usr/bin/javadoc @options @packages
#10 54.78 [ERROR] 
#10 54.78 [ERROR] Refer to the generated Javadoc files in '/app/moa/moa/target/apidocs' dir.
#10 54.78 [ERROR] 
#10 54.78 [ERROR] -> [Help 1]
#10 54.78 [ERROR] 
#10 54.78 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
#10 54.78 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
#10 54.78 [ERROR] 
#10 54.78 [ERROR] For more information about the errors and possible solutions, please read the following articles:
#10 54.78 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
#10 54.78 [ERROR] 
#10 54.78 [ERROR] After correcting the problems, you can resume the build with the command
#10 54.78 [ERROR]   mvn <goals> -rf :moa
#10 ERROR: process "/bin/sh -c cd moa &&     export JAVA_HOME=\"/usr\" &&     mvn clean install -DskipTests=true &&     mvn -f release.xml package -DskipTests=true" did not complete successfully: exit code: 1
------
 > [ 7/12] RUN cd moa &&     export JAVA_HOME="/usr" &&     mvn clean install -DskipTests=true &&     mvn -f release.xml package -DskipTests=true:
#10 54.78 [ERROR] -> [Help 1]
#10 54.78 [ERROR] 
#10 54.78 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
#10 54.78 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
#10 54.78 [ERROR] 
#10 54.78 [ERROR] For more information about the errors and possible solutions, please read the following articles:
#10 54.78 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
#10 54.78 [ERROR] 
#10 54.78 [ERROR] After correcting the problems, you can resume the build with the command
#10 54.78 [ERROR]   mvn <goals> -rf :moa
------
devel-gui.Dockerfile:27
--------------------
  26 |     
  27 | >>> RUN cd moa && \
  28 | >>>     export JAVA_HOME="/usr" && \
  29 | >>>     mvn clean install -DskipTests=true && \
  30 | >>>     mvn -f release.xml package -DskipTests=true
  31 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c cd moa &&     export JAVA_HOME=\"/usr\" &&     mvn clean install -DskipTests=true &&     mvn -f release.xml package -DskipTests=true" did not complete successfully: exit code: 1
Error: buildx failed with: ERROR: failed to solve: process "/bin/sh -c cd moa &&     export JAVA_HOME=\"/usr\" &&     mvn clean install -DskipTests=true &&     mvn -f release.xml package -DskipTests=true" did not complete successfully: exit code: 1

We need to bump the Java version in the docker image to fix this

nuwangunasekara commented 1 year ago

Fixed via commit 5a1d26b