Hello Daniel,

I'll re-post with updates my github comment here since I imagine not everyone will read the PR comments.


I think trying to meddle with those configs at build time is brittle and would complicate the build.

It would help to have the ability to add jars and configuration files to the classpath - since that is where ofbiz looks for.

So the idea is to make it easy for people to add things at the BEGINING of the classpath so they can override ofbiz configurations (and / or libraries ?!)

I believe this can achieved for both gradle deploy and binary (ofbiz.tar) deploy with minimal changes.

If you could add the code snippet bellow to build.gradle then people can add files to config/ and lib-extra/ directories and they will be available for ofbiz when it starts.

I've tested this and it works for my ofbiz docker build (I'm planning an article these next 2 days and will share it. Spoiler: it works on ARM - raspberry pi 4 ;) ).

I'm also adding the database drivers post build to lib-extra .

That way I can keep the ofbiz source unchanged and still get what I need.

(I don't have windows to test the classpath ).

tasks.startScripts {
    doLast {
        // Alter the start script for Unix systems.
        unixScript.text =
                unixScript.text.replace('CLASSPATH=$APP_HOME/lib',

'CLASSPATH=$APP_HOME/config/:$APP_HOME/lib-extra/*:$APP_HOME/lib')

        // Alter the start script for Windows systems.
//        windowsScript.text =
//                windowsScript.text.replace('CLASSPATH=$APP_HOME/lib',
// 'CLASSPATH=$APP_HOME\\conf\\:$APP_HOME/lib-extra/*:$APP_HOME/lib')
    }
}


For adding things to the classpath when running gradle there is something in place:

// Libraries downloaded manually
implementation fileTree(dir: file("${rootDir}/lib"), include: '**/*.jar')



--
Eugen Stan
+40720 898 747 / netdava.com

Reply via email to