You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Ioan Eugen Stan (Jira)" <ji...@apache.org> on 2021/01/14 15:07:00 UTC

[jira] [Created] (OFBIZ-12136) Add extra classpath directories for ofbiz.tar/zip distribution

Ioan Eugen Stan created OFBIZ-12136:
---------------------------------------

             Summary: Add extra classpath directories for ofbiz.tar/zip distribution
                 Key: OFBIZ-12136
                 URL: https://issues.apache.org/jira/browse/OFBIZ-12136
             Project: OFBiz
          Issue Type: Improvement
            Reporter: Ioan Eugen Stan


See [https://lists.apache.org/thread.html/r210c63f3f0d6efd0b4fe2e2141689ae501c518671cfe1e5d4f7a9417%40%3Cdev.ofbiz.apache.org%3E |https://lists.apache.org/thread.html/r210c63f3f0d6efd0b4fe2e2141689ae501c518671cfe1e5d4f7a9417%40%3Cdev.ofbiz.apache.org%3E]

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 since gradle hardcodes the classpath at build. Adding new jars to lib/ does not do anything. 
 
That way I can keep the ofbiz source unchanged and still get what I need. 
{code:java}
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')
    }
} 
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)