Error while running processing with Maven

I’m trying to run an app build with maven with processing-core dependency. As far as I can tell there is problem with one of the internal dependencies in library’s POM file that prevents program from recognizing processing/core/PApplet. Is there anything that can be done to solve this?

Here is my pom.xml file

<xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.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.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <version>1.0</version>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>14</maven.compiler.source>
    <maven.compiler.target>14</maven.compiler.target>
  </properties>

  <dependencies>
    <!-- https://mvnrepository.com/artifact/org.processing/core -->
    <dependency>
      <groupId>org.processing</groupId>
      <artifactId>core</artifactId>
      <version>3.3.7</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Here is my main class:

package com.mycompany.app;

import processing.core.PApplet;

public class App extends PApplet {
    public static void main( String[] args ) {
        PApplet.main(App.class, args);
        System.out.println( "Hello World!" );
    }
}

My setup:

$ mvn -version
Apache Maven 3.6.3
Maven home: /usr/share/maven
Java version: 14.0.2, vendor: Private Build, runtime: /usr/lib/jvm/java-14-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.8.0-33-generic", arch: "amd64", family: "unix"

Relevant error after running mvn package -X

[WARNING] The POM for org.processing:core:jar:3.3.7 is invalid, transitive dependencies (if any) will not be available: 1 problem was encountered while building the effective model for org.processing:core:3.3.7
[ERROR] 'dependencies.dependency.systemPath' for com.apple:AppleJavaExtensions:jar must specify an absolute path but is ${project.basedir}/apple.jar @ 

Error after running $ java -cp target/my-app-1.0.jar com.mycompany.app.App

Error: Could not find or load main class com.mycompany.app.App
Caused by: java.lang.NoClassDefFoundError: processing/core/PApplet

I’ve tried different available versions at Maven repository

There are two types of dependency to consider, compile time and runtime. You need both how you provide them is up to you, normally it is easier just to include the runtime jar yourself (and place on classpath) but you could use maven to to download the jar for you. However the maven repository is (unofficial not supported and out of date) probably not what you want.

I will try to make maven use local repository. Thank you.
Also it’s strange that there is no official supported version of procesing core maven repo.

Using Processing 3.x with JDK and/or compiler source 14 is unlikely to work anyway. Anything above 8 is likely to give you issues.

I have a Java 11+ fork of Processing 3.5.3 at https://search.maven.org/search?q=g:org.praxislive.libp5x but it needs a bit of work to use with anything other than LWJGL renderer. More for internal use at the moment, but I intend to tidy up and support other use as soon as I get some time to work on it.