Clean maven install - error occurs

Hi

I am attempting to install dl4j-examples (cloned from github.com

The cloning appears to be fine

I then cd dl4j-examples/dl4j-examples (where a POM file exists)

I then ‘mvn clean install’

It appears to run OK for a while and then I strike the following error…

[ERROR] Failed to execute goal com.lewisd:lint-maven-plugin:0.0.11:check (pom-lint) on project dl4j-examples: Execution pom-lint of goal com.lewisd:lint-maven-plugin:0.0.11:check failed: An API incompatibility was encountered while executing com.lewisd:lint-maven-plugin:0.0.11:check: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.lewisd:lint-maven-plugin:0.0.11
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/rgmat/.m2/repository/com/lewisd/lint-maven-plugin/0.0.11/lint-maven-plugin-0.0.11.jar
[ERROR] urls[1] = file:/C:/Users/rgmat/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[2] = file:/C:/Users/rgmat/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[3] = file:/C:/Users/rgmat/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[4] = file:/C:/Users/rgmat/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar

This is all new to be and I don’t know how to correct this problem

Any advice gratefully received

Bob_M
New Zealand

@Bob_M this coudl either be a corrupt m2 folder, a JDK issue, or a maven version issue.
Ensure you are using jdk 11 or 17, you are using the altest version of maven and lastly delete your .m2 and start again if none of those work.

Thanks for your reply…
I upgraded to jdk 17.0.4.1
maven version is 3.8.7

deleted .m2 folder and reran…got the following error messages

Downloaded from central: https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0.jar (2.3 MB at 225 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6.jar (233 kB at 23 kB/s)
[INFO] Writing summary report
[INFO] [LINT] Completed with no violations
[INFO] Writing xml report
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16:09 min
[INFO] Finished at: 2023-01-15T14:05:16+13:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.lewisd:lint-maven-plugin:0.0.11:check (pom-lint) on project dl4j-examples: Execution pom-lint of goal com.lewisd:lint-maven-plugin:0.0.11:check failed: An API incompatibility was encountered while executing com.lewisd:lint-maven-plugin:0.0.11:check: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>com.lewisd:lint-maven-plugin:0.0.11
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/rgmat/.m2/repository/com/lewisd/lint-maven-plugin/0.0.11/lint-maven-plugin-0.0.11.jar
[ERROR] urls[1] = file:/C:/Users/rgmat/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.22/plexus-utils-3.0.22.jar
[ERROR] urls[2] = file:/C:/Users/rgmat/.m2/repository/org/sonatype/sisu/sisu-inject-bean/1.4.2/sisu-inject-bean-1.4.2.jar
[ERROR] urls[3] = file:/C:/Users/rgmat/.m2/repository/org/sonatype/sisu/sisu-guice/2.1.7/sisu-guice-2.1.7-noaop.jar
[ERROR] urls[4] = file:/C:/Users/rgmat/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar
etc. etc.

@Bob_M try with jdk 11 and see if that helps. I’ll look in to this this week.

@Bob_M I removed the offending plugin from the examples. JDK 17 should be fine now.

Hi, I too am trying to install the project dl4j-examples. My default jdk is java 11.
After cloning the git repo today and executing mvn clean install I got the following error:
[ERROR] Failed to execute goal on project dl4j-examples: Could not resolve dependencies for project org.deeplearning4j:dl4j-examples:jar:1.0.0-SNAPSHOT: The following artifacts could not be resolved: org.nd4j:nd4j-native:jar:macosx-arm64:1.0.0-SNAPSHOT, org.bytedeco:openblas:jar:macosx-arm64:0.3.17-1.5.6, org.nd4j:nd4j-native-preset:jar:macosx-arm64:1.0.0-SNAPSHOT, org.deeplearning4j:resources:jar:1.0.0-SNAPSHOT: Could not find artifact org.nd4j:nd4j-native:jar:macosx-arm64:1.0.0-SNAPSHOT in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots)[Help 1]
[ERROR]

Thanks for any advice or explanation.

lerzegov
Italy

I have the exact same error…hopefully Adam is working on a solution :slight_smile:

@Bob_M could you clarify? I already pushed the lint maven plugin removal and didn’t see any followup issue from you.

@lerzegov 's issue is completely unrelated to yours. Yours if you read the error was related to 1 maven plugin left over in the examples.

@lerzegov Aside from that…I’m seeing 1.5.6 in here. That’s clearly old (more than 2 versions back) Im not sure what your version is and you haven’t put anything I can go off of here. The pom or anything so I have to disregard this.

Please try the example as they are on master with a fresh clone and let me know if you still have issues then.

@agibsonccc , thanks for your feedback. Sorry for posting in this thread, I guessed that the “Clean maven install - error occurs” coulb be on topic also for my issue.

Following your advice I removed the installation and did a fresh clone
git clone GitHub - deeplearning4j/deeplearning4j-examples: Deeplearning4j Examples (DL4J, DL4J Spark, DataVec)
I don’t have previous installations of deeplearning4j.
Doing mvn clean install in the /dl4j-examples follder I still get the same error reported in my previous post
[ERROR] Failed to execute goal on project dl4j-examples: Could not resolve dependencies for project org.deeplearning4j:dl4j-examples:jar:1.0.0-SNAPSHOT: The following artifacts could not be resolved: org.nd4j:nd4j-native:jar:macosx-arm64:1.0.0-SNAPSHOT, org.bytedeco:openblas:jar:macosx-arm64:0.3.17-1.5.6, org.nd4j:nd4j-native-preset:jar:macosx-arm64:1.0.0-SNAPSHOT, org.deeplearning4j:resources:jar:1.0.0-SNAPSHOT: Could not find artifact org.nd4j:nd4j-native:jar:macosx-arm64:1.0.0-SNAPSHOT in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots)[Help 1]
[ERROR]
The pom.xlm is the one downloaded cloning the git repo.
Importing the project into IntelliJ I get the same error about missing jars.

@lerzegov ah you’re running on an m1. Only a subset of the libraries work for m1. I will need to do a set of 1 off examples for that. Due to the limited number of libraries supported in M1 basically you run the library but a lot of the other libraries it normally comes with won’t work. Thusly it’s not enabled by default (eg: in nd4j-native-platform) in order to work around that you’d have to do something like this:

The person there manually configures nd4j-native,openblas and nd4j-native with the macosx-arm64 clasifier in order to run.

@agibsonccc Tanks for the clarification: if I get it, the ND4J M2-1 release works on the 2nd generation Apple M2 chips, I am on M1 pro chip. I will try the workaround suggested in the linked post.

Note: the M2 version of ND4J means “Milestone 2”.

As for Apple M1 and M2: the problem @agibsonccc is talking about is that not all libraries that the full DL4J distribution depends on, are available for that architecture. For this reason, we don’t automatically support those chips when you use the nd4j-native-platform dependency.

The linked workaround explains how to collect the minimal set of native dependencies to make nd4j’s numerical code work.

@treo Thanks for correcting my naive reading of the M1/M2 milestone markers.

I tried to amend the dependency declarations both in maven and in gradle as explained in the linked post. After several attempts, I have a project that loads and builds without errors in IntelliJ. However, when I run Java examples, I get runtime errors.
For example, running QuickTest.java or MNISTAutoencoder.java I get
Could not find jniopenblas_nolapack in class, module, and library path

Not being able to ascertain issues related to project configuration from problems depending on unsupported features on M1 chips, I prefer to postpone my experiments with deeplearning4j.
Thanks for supporting my attempts.

@lerzegov could you give us an idea of what you are still having issues with and a bit about your configuration? I respect you waiting but we’ve had successes with other folks. I feel like it could be an older version of something you’re still using. I don’t think that’s necessarily related to the project.

Up until recently the upstream openblas from 1.5.7 actually didn’t fully work on M1 but was fixed in 1.5.8. I’d like to confirm what you did/didn’t try and maybe we can get you up and running.

@agibsonccc Thanks for encouraging me! Actually after tweaking the pom.xml following the directions in the post, mvn clean install succeeded and I could load the project into IntelliJ.
I am running the examples listed in README.md and everything is going fine so far.

Here are the changes in the pom.xml
modified:

<properties>
    <dl4j-master.version>1.0.0-M2.1</dl4j-master.version>
 </properties>

added:

    <dependency>
        <groupId>org.bytedeco</groupId>
        <artifactId>openblas</artifactId>
        <version>0.3.21-1.5.8</version>
    </dependency>
1 Like