Processing 4 processing-java binary?

Hello @stefterv,

Clearly I am out of my element but learning!
I made some updates after revisiting this.

I took on the challenge of building a Processing 4.4.10 project with Maven (command-prompt only) using the posted POM, but ran into dependency failures for the P2D renderer.

The issue was that the JOGL 2.5.0 files needed by Processing were not available in the Maven Central repository.

I changed file to 2.6.0 which resolved errors; JAVA2D worked (did not need those files) but P2D/P3D builds gave errors.

The final fix for P2D/P3D was to configure pom.xml to use an alternative repository for the 2.5.0 versions.

** Update ** Version 2
The dependencies are sourced from the Maven Central Repository (for Processing Core and Kotlin) and the JogAmp Repository (for JOGL and GlueGen), which is specified in the <repositories> section.

After all that was said and done these POMs worked for my consumer project:

Version 2 pom.xml
<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>

    <!-- YOUR PROJECT COORDINATES -->
    <groupId>com.mycompany.processing</groupId>
    <artifactId>my-processing-app</artifactId>
    <version>1.0-SNAPSHOT</version>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <!-- Stable JOGL version -->
        <jogamp.version>2.5.0</jogamp.version>
    </properties>

    <dependencies>
        <!-- 1. Processing 4.4.10 Core Library -->
        <dependency>
            <groupId>org.processing</groupId>
            <artifactId>core</artifactId>
            <version>4.4.10</version>
        </dependency>
        
        <!-- 2. Kotlin Standard Library -->
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>2.0.20</version>
            <scope>compile</scope>
        </dependency>
        
        <!-- 3. JOGL 2.5.0 Dependencies (Set to 'compile' for successful application build) -->
        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all-main</artifactId>
            <version>${jogamp.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt-main</artifactId>
            <version>${jogamp.version}</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <!-- Repositories for JOGL (Required to find the jogamp artifacts) -->
    <repositories>
        <repository>
            <id>jogamp-all</id>
            <name>JogAmp Maven Repository</name>
            <url>https://jogamp.org/deployment/maven/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <plugins>
            <!-- 1. Copies native DLL/SO files to target/natives -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <id>copy-natives</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/natives</outputDirectory>
                            <includeGroupIds>org.jogamp</includeGroupIds>
                            <excludeTransitive>true</excludeTransitive>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <!-- 2. Creates a single executable JAR (Shade Plugin) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>com.mycompany.processing.App</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
Version 1 pom.xml
<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.processing</groupId>
    <artifactId>my-processing-app</artifactId>
    <version>1.0-SNAPSHOT</version>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <jogamp.version>2.5.0</jogamp.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.processing</groupId>
            <artifactId>core</artifactId>
            <version>4.4.10</version>
        </dependency>
        
        <dependency>
            <groupId>org.jogamp.jogl</groupId>
            <artifactId>jogl-all-main</artifactId>
            <version>${jogamp.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jogamp.gluegen</groupId>
            <artifactId>gluegen-rt-main</artifactId>
            <version>${jogamp.version}</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>jogamp-maven-path</id>
            <name>JogAmp Maven Path</name>
            <url>https://jogamp.org/deployment/maven/</url>
        </repository>
        <repository>
            <id>scijava.public</id>
            <name>SciJava Public</name>
            <url>https://maven.scijava.org/content/groups/public</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.6.1</version>
                <executions>
                    <execution>
                        <id>copy-natives</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/natives</outputDirectory>
                            <includeGroupIds>org.jogamp</includeGroupIds>
                            <excludeTransitive>true</excludeTransitive>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.5.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>com.mycompany.processing.App</mainClass>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

@stefterv , Is this something I should submit as an issue?

Some notes on my development process:

Notes

I collaborated with Google Gemini and ChatGPT to guide me through the maven build and resolve the JOGL dependency conflict and it was initially very frustrating. The AI tools offered solutions, alternatives, dead ends, incorrect information, iteration loops and the process required me to persistently validate, correct, refine and simplify instructions to overcome these hurdles, finally resulting in a working configuration for my "consumer project*.

I still needed to do a final edit as it missed out on some important details.

At one point Google Gemini even stated this incorrect information:

My source for the availability of 4.5.4 is the Maven Central Repository , which is the canonical source for Maven dependencies:

  • Artifact: org.processing:core
  • Version: 4.5.4
  • URL: https://repo1.maven.org/maven2/org/processing/core/ (You can check this URL; the directory listing confirms 4.5.4 is available.)

I checked and it is not there! It later corrected itself once I challenged this.

This was a challenging exercise and I certainly learned a lot along the way.

:)

1 Like