Dl4j-examples - clean build failure - missing org.deeplearning4j:resources:jar:1.0.0-SNAPSHOT

New to DL4J, I pulled down the entire deeplearning4j-examples for review. Following the basic steps from the tutorials quick-start (Quick Start - Deeplearning4j).
Running on Windows 11, JDK 1.8, Maven 4.0 (latest) environment which seems to meet the requirements listed in the quick start guide.

Tried the following three basic repository steps

> git clone https://github.com/eclipse/deeplearning4j-examples.git
> cd dl4j-examples/
> mvn clean install

However during the “mvn clean install”, the build fails with a missing POM error during the downloads (apparently from “sonatype.org”) and subsequent missing jar file as shown per below.

D:\dl4j\deeplearning4j-examples>cd D:\dl4j\deeplearning4j-examples\dl4j-examples

D:\dl4j\deeplearning4j-examples\dl4j-examples>mvn clean install
[INFO] Scanning for projects...
[INFO] --------------------------------------< org.deeplearning4j:dl4j-examples >--------------------------------------
[INFO] Building Introduction to DL4J 1.0.0-SNAPSHOT
[INFO] from pom.xml
[INFO] ----------------------------------------------------[ jar ]-----------------------------------------------------


Downloaded from central: https://repo.maven.apache.org/maven2/net/java/jvnet-parent/3/jvnet-parent-3.pom (4.8 kB at 114 kB/s)
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/deeplearning4j/resources/1.0.0-SNAPSHOT/maven-metadata.xml
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/deeplearning4j/resources/1.0.0-SNAPSHOT/resources-1.0.0-SNAPSHOT.pom
[WARNING] The POM for org.deeplearning4j:resources:jar:1.0.0-SNAPSHOT is missing, no dependency information available
Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/deeplearning4j/deeplearning4j-ui/1.0.0-SNAPSHOT/maven-metadata.xml
Downloaded from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/org/deeplearning4j/deeplearning4j-ui/1.0.0-SNAPSHOT/maven-metadata.xml (1.0 kB at 9.2 kB/s)

[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] ----------------------------------------------------------------------------------------------------------------
[INFO] Total time: 01:39 min
[INFO] Finished at: 2023-01-24T09:06:15-08:00
[INFO] ----------------------------------------------------------------------------------------------------------------
[ERROR] Failed to execute goal on project dl4j-examples: Could not resolve dependencies for project org.deeplearning4j:dl4j-examples:jar:1.0.0-SNAPSHOT: Could not find artifact org.deeplearning4j:resources:jar:1.0.0-SNAPSHOT in sonatype-nexus-snapshots (https://oss.sonatype.org/content/repositories/snapshots) -> [Help 1]

@BrRoBo apologies that’s fixed. It’s on M2.1 now (the latest stable version) Thanks for flagging!

Cool. Thanks for taking that on so quick! Ran through it again and got past that original error but now another… sorry.

So, I am trying to use this env setup…

D:\dl4j\deeplearning4j-examples\dl4j-examples>mvn -version
Apache Maven 4.0.0-alpha-3 (2ccf57baa5191468f9911fe85fd99672ac3bacb9)
Maven home: d:\maven
Java version: 1.8.0_351, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jre1.8.0_351
Default locale: en_US, platform encoding: Cp1252
OS name: “windows 11”, version: “10.0”, arch: “amd64”, family: “windows”

Unfortunately the build seems to need a lower version of Maven, or something else to meet the requirements?

mvn clean install

D:\dl4j\deeplearning4j-examples\dl4j-examples>mvn clean install
[INFO] Scanning for projects…
[INFO] -------------------------------------------< org.deeplearning4j:dl4j-examples >-------------------------------------------
[INFO] Building Introduction to DL4J 1.0.0-SNAPSHOT
[INFO] from pom.xml
[INFO] ---------------------------------------------------------[ jar ]----------------------------------------------------------

[INFO] — clean:3.1.0:clean (default-clean) @ dl4j-examples —
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.pom

Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/3.0/maven-plugin-api-3.0.jar (49 kB at 210 kB/s)
[INFO] — enforcer:1.0.1:enforce (enforce-default) @ dl4j-examples —

[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] --------------------------------------------------------------------------------------------------------------------------
[INFO] Total time: 28.623 s
[INFO] Finished at: 2023-01-24T21:10:51-08:00
[INFO] --------------------------------------------------------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0.1:enforce (enforce-default) on project dl4j-examples: Execution enforce-default of goal org.apache.maven.plugins:maven-enforcer-plugin:1.0.1:enforce failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-enforcer-plugin:1.0.1:enforce: java.lang.NoSuchMethodError: org.apache.maven.plugin.PluginParameterExpressionEvaluator.(Lorg/apache/maven/execution/MavenSession;Lorg/apache/maven/plugin/MojoExecution;Lorg/apache/maven/project/path/PathTranslator;Lorg/codehaus/plexus/logging/Logger;Lorg/apache/maven/project/MavenProject;Ljava/util/Properties;)V
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.0.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/bryan/.m2/repository/org/apache/maven/plugins/maven-enforcer-plugin/1.0.1/maven-enforcer-plugin-1.0.1.jar

@BrRoBo please use maven 3.x. I haven’t investigated 4.x yet. It’s fairly new,

Perhaps the Quick Start guide should be reworded then. Understandably, it was written some time ago, however as it is, it states " Install or update Maven to the latest release following their instructions for your system.".

Currently, Maven 4.x is the latest, but apparently beyond what the build can handle. Latest 3.x would be more clear.

Also changed my Java to JDK 11 to match the current classes. Another error in the Quick Start guide which says JDK 1.7 or later :confused:

Thanks again!

@BrRoBo let me do an update. I planned on redoing some things after the next release. Let me know if you find anything else and we’ll get that taken care of. Actually maven 4.0 literally just launched so the status quo hasn’t changed in quite some time. So not a lot has really needed to be done on that front. Sorry for the confusion!

@BrRoBo I made sure to clarify both the maven and java versions as you saw. For reference, jdk 11 and 17 are the main ones. I also added a note for maven 3.x.

Ty. BTW, the pom also still refers to the old min java version :wink:

@BrRoBo thanks let me take a look at that. Most stuff should not be impacted by that. Were you able to run the examples with jdk 8 or did you need to fully update to 11? Some aspects of the dl4j source code when we added java 9 modules did break compiling it with jdk 8 but we should be still outputting source that runs on jdk 8.

Please do let me know if it actually stops you from running things and if so I’ll update it.

I plan on taking a larger look at the examples after the release. We at least need to add some better examples for transformers and pretrained models among other things. I wanted to update everything then.

Trying to use JDK 8 was a show stopper because the java class byte code is version 55 (java 11) instead of 52 (java 8), and so would not complete the maven clean install (build). Thought that was a bit goofy since the pom currently specifies java 1.8 as the min (and the doc was even lower at 1.7). The examples built fine with java 11.

@BrRoBo ahh ok! Yeah some of it was just out of date. I’ll have to see if lowering the output class version has any impact on performance or anything. Could you point at which pages still mention jdk 7? If so I’ll update that as well. Likely going forward though jdk 8 will be a very special case. Most big companies have moved on from jdk 8.

It’s market share is shrinking every day. Meanwhile I see a ton of jdk 11.

I have no problem using JDK 11, there was just some basic confusion over the prereqs plus double checking in the pom for build reqs all indicated sub 11 was ok. So for now, it looks like you’ve got the Quick Start guide updated to 11. The pom should also be updated to reflect the java version to match the compiled class version… avoiding the more cryptic class version error from javac by having Maven enforce the java version min.

Thanks again.