- Notifications
You must be signed in to change notification settings - Fork563
Apache OFBiz is an open source product for the automation of enterprise processes. It includes framework components and business applications for ERP, CRM, E-Business/E-Commerce, Supply Chain Management and Manufacturing Resource Planning. OFBiz provides a foundation and starting point for reliable, secure and scalable enterprise solutions.
License
apache/ofbiz-framework
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Welcome toApache OFBiz! A powerful top level Apache software project. OFBizis an Enterprise Resource Planning (ERP) System written in Java and houses alarge set of libraries, entities, services and features to run all aspects ofyour business.
For more details about OFBiz please visit the OFBiz Documentation page:
Note | If you want to use Eclipse, read theSetup eclipse project for OFBizsection to set it up. |
Note | If you want to use an external database like MySQL or PostgreSQL, readtheSetup an external database section to set it up. |
Note | If you want to run OFBiz without an internet connection, read theRunning gradle tasks without an internet connection section. |
Note | The directory structure and repositories have changed. For moreinformation read theRepository and directory structure section. |
Note | If you are in China you may encounter network issues or proxy settings. That’s of course unrelated to OFBiz. |
The only requirements to run OFBiz is
to have the Java Development Kit (JDK) version 17 installed on your system(not just the JRE, but the full JDK) that you can download from the below link.Make sure of setting the $JAVA_HOME environment variable.
JDK download.To know more about the JDK
Warning | On Windows don’t put OFBiz in a directory with space/s in the path. |
If on Windows, a Powershell version >= 7.1.3 installed that you can download from the below link.
Powershell
To quickly install and fire-up OFBiz, please follow the below instructions fromthe command line at the OFBiz top level directory (folder).
MS Windows:init-gradle-wrapper
Important |
follow the advice there:https://s.apache.org/vdcv8. If you want more details see:https://s.apache.org/urnju
|
Note | If you wonder where are stored the PowerShell Executables, here are the answers:https://s.apache.org/w5dye |
Unix-like OS:./gradle/init-gradle-wrapper.sh
Note: Depending on your Internet connection speed it might take a long timefor this step to complete if you are using OFBiz for the first time as it needsto download all dependencies. So please be patient!
MS Windows:gradlew cleanAll loadAll
Unix-like OS:./gradlew cleanAll loadAll
Warning | This command deletes all previous data and resets it to the initial demo data. |
MS Windows:gradlew ofbiz
Unix-like OS:./gradlew ofbiz
Note: Ignore the % progress indicator because this task does not end as longas OFBiz is running.
You can log in with the useradmin and passwordofbiz.
Note | In case of problems visit ourFurther reading section. |
If you want to set and use Docker,here is the documentation
Note | Currently deployment configuration is tied to the source code. If you want to separate deployment configuration from production code we recommend using Docker, seeDocker section above. |
Following is a simple production setup. For more detailed information visitApache OFBiz Technical Production Setup Guide.
Copy the archive frombuild/distributions
directory to the server and unarchive them withtar xf
orunzip
.
From the unarchived directory you can run eitherbin/ofbiz
shell script orbin/ofbiz.bat
batch script.
MS Windows: you can usenssm
Unix-like OS:This article might give you an idea, although it seems to be outdated. Either way, you can use the standard mechanism of your distribution, like for example creating an/etc/systemd/system/ofbiz.service
file.
If you find a pre-auth security issue, please report it to: security @ ofbiz.apache.org.Once proper mitigations to the security issues are complete the OFBiz team willdisclose this information to the public mailing list.
If you find a post-auth security issue, pleasecreate a bug in our issue tracker (Jira) .
If you want to use AJP on a non localhost OFBiz instance, you need to set the value of allowedRequestAttributesPatternin framework/catalina/ofbiz-component.xml
You can find more information about security in OFBiz atKeeping OFBiz secure
Caution | In production never use the credentials contained in demo data. Not only the admin credentials, but all of them. Also we recommend to not use Windows Server in production because we are not supporting specific Windows related security issues. |
All build tasks are executed using theGradle build system which is embeddedin OFBiz. To execute build tasks go to OFBiz top-level directory (folder) andexecute tasks from there.
The syntax for tasks differ slightly between windows and Unix-like systems
Windows:
gradlew <tasks-in-here>
Unix-like:
./gradlew <tasks-in-here>
For the rest of this document, we will use the windows syntax, if you are on aUnix-like system, you need to add the./
to gradlew
There are two types of tasks designed for OFBiz in Gradle:
Standard tasks: To execute general standard Gradle tasks
OFBiz server tasks: To execute OFBiz startup commands. These tasks startwith one of the following words:
ofbiz : standard server commands
ofbizBackground ; server commands running in a background forked process
Tips:
OFBizserver commands require"quoting" the commands. For example:
gradlew "ofbiz --help"
Shortcuts to task names can be used by writing the first letter of every wordin a task name. However, you cannot use the shortcut form for OFBiz servertasks. Example:
gradlew loadAdminUserLogin -PuserLoginId=myadmin
=gradlew lAUL -PuserLoginId=myadmin
Dependent tasks can be skipped with the -x switch. Example:
gradlew build -x test
does not run the tests within the build.
gradlew "ofbiz --help"
gradlew "ofbiz --test" --debug-jvm
gradlew "ofbizBackground --start --portoffset 10000"
gradlew "ofbiz --shutdown --portoffset 10000"
gradlew ofbiz
(default is --start)
You can use the below common list of tasks as a quick reference for controllingthe system. This document uses the windows task syntax, if you are on aUnix-like system, you need to add the./
to gradlew i.e../gradlew
List all available commands to control the OFBiz server
gradlew "ofbiz --help"
Terminate all running OFBiz server instances by calling the appropriateoperating system kill command. Use this command to force OFBiz termination ifthe --shutdown command does not work. Usually this is needed when in the middleof data loading or testing in OFBiz.
Warning: Be careful in using this command as force termination might lead to inconsistent state / data
gradlew terminateOfbiz
Starts OFBiz in remote debug mode and waits for debugger or IDEs to connect onport5005
gradlew ofbiz --debug-jvm
Start OFBiz of the network port offsetted by the range provided in the argumentto --portoffset
gradlew "ofbiz --start --portoffset 10000"
Start OFBiz in the background by forking it to a new process and redirecting theoutput toruntime/logs/console.log
gradlew "ofbizBackground --start"
OR
gradlew ofbizBackground
You can also offset the port, for example:
gradlew "ofbizBackground --start --portoffset 10000"
OFBiz contains the following data reader types:
seed: OFBiz and External Seed Data - to be maintained along with source andupdated whenever a system deployment is updated
seed-initial: OFBiz and External Seed Data - to be maintained along withsource like other seed data, but only loaded initially and not updated when asystem is updated except manually reviewing each line
demo: OFBiz Only Demo Data
ext: External General Data (custom)
ext-test: External Test Data (custom)
ext-demo: External Demo Data (custom)
tenant: Data to load into the master tenants database "ofbiztenant". Thisdata is required to identify where a tenant’s database is located. For moreinformation you can review the relevanttenantdocumentation
Available options for the --load-data server command are the following:
readers=[name]: only load data from certain readers separated by comma. e.g.seed,seed-initial,ext
file=[path]: load a single file from location or several files separated bycommas. e.g. /my/file/1,/my/file/2
dir=[path]: load all data files found in directory
component=[name]: only load data from a specific component. e.g. base
delegator=[name]: use the defined delegator. Default is "default". If thevalue passed is"all-tenants" then OFBiz will load the data for all definedtenants in the system.
group=[name]: override the entity group (org.apache.ofbiz). e.g.com.example.something
timeout=[millis]: timeout in milliseconds
create-pks: create primary keys
drop-pks: drop primary keys
create-constraints: create indexes and foreign keys after loading
drop-constraints: drop indexes and foreign keys before loading
create-fks: create dummy (placeholder) foreign keys
maintain-txs: maintain timestamps in data file
try-inserts: use mostly inserts
repair-columns: repair column sizes (default is true w/ drop-constraints)
continue-on-failure: By default OFBiz will fail and stop if it is unable toload any of the files it is attempting to load. By passing this property OFBizwill ignore failures and continue loading all files
you can choose which data readers to pass in the following syntax:
gradlew "ofbiz --load-data readers=<readers-here-comma-separated>"
Example:
gradlew "ofbiz --load-data readers=seed,seed-initial,ext,ext-demo"
Beware that copying this command in Microsoft Word will automatically transformthe double dash in en dashes (Unicode 0x2013: –) Other cases not related to Wordwere also reported.So when this command does not work check that you are usingdash!
Loads all data sets; meant for initial loading of generic OFBiz data. Can beapplied for development, testing, demonstration, etc. purposes. Be aware thatexecuting this task can result in your data being overwritten in your databaseof choice.
gradlew loadAll
ORgradlew "ofbiz --load-data"
Caution | Use with caution in production environments. |
Load ONLY the seed data (not seed-initial, demo, ext* or anything else); meantfor use after an update of the code to reload the seed data as it is generallymaintained along with the code and needs to be in sync for operation
gradlew "ofbiz --load-data readers=seed"
Load seed, seed-initial and ext data; meant for manual/generic testing,development, or going into production with a derived system based on stock OFBizwhere the ext data basically replaces the demo data
gradlew "ofbiz --load-data readers=seed,seed-initial,ext"
Load seed, seed-initial, ext and ext-test data; meant for automated testing witha derived system based on stock OFBiz
gradlew "ofbiz --load-data readers=seed,seed-initial,ext,ext-test"
Load data from an XML file holding entity data.
gradlew "ofbiz --load-data file=foo/bar/FileNameHere.xml"
Create a new tenant in your environment, create the delegator, load initial datawith admin-user and password (needs multitenant=Y in general.properties). Thefollowing project parameters are passed:
tenantId: mandatory
tenantName: optional, default is value of tenantId
domainName: optional, default is org.apache.ofbiz
tenantReaders: optional, default value is seed,seed-initial,demo
dbPlatform: optional, D(Derby), M(MySQL), O(Oracle), P(PostgreSQL) (default D)
dbIp: optional, ip address of the database
dbUser: optional, username of the database
dbPassword: optional, password of the database
gradlew createTenant -PtenantId=mytenant
gradlew createTenant -PtenantId=mytenant -PtenantName="My Name" -PdomainName=com.example -PtenantReaders=seed,seed-initial,ext -PdbPlatform=M -PdbIp=127.0.0.1 -PdbUser=mydbuser -PdbPassword=mydbpass
If run successfully, the system creates a new tenant having:
delegator: default#${tenandId} (e.g. default#mytenant)
admin user: ${tenantId}-admin (e.g. mytenant-admin)
admin user password: ofbiz
Load data for one specific tenant in a multitenant environment. Note that youmust set multitenant=Y in general.properties and the following projectparameters are passed:
tenantId (mandatory)
tenantReaders (optional)
tenantComponent (optional)
gradlew loadTenant -PtenantId=mytenant
gradlew loadTenant -PtenantId=mytenant -PtenantReaders=seed,seed-initial,demo -PtenantComponent=base
gradlew testIntegration
OR
gradlew 'ofbiz --test'
It is possible to start integration tests with a log level different from thedefault one. The log levels allowed are listed below from most verbose to leastverbose:
always
verbose
timing
info
important
warning
error
fatal
gradlew "ofbiz --test loglevel=fatal"
Run a test case, in this example the component is "entity" and the case name is"entity-tests"
gradlew "ofbiz --test component=entity --test suitename=entitytests --test case=entity-query-tests"
Listens on port5005
gradlew "ofbiz --test component=entity --test loglevel=verbose" --debug-jvm
gradlew "ofbiz --test component=entity --test suitename=entitytests"
Listens on port5005
gradlew "ofbiz --test component=entity --test suitename=entitytests" --debug-jvm
Create an admin user with login name MyUserName and default password with value"ofbiz". Upon first login OFBiz will request changing the default password
gradlew loadAdminUserLogin -PuserLoginId=MyUserName
By default Xlint prints output of all warnings detected by the compiler, if youwant to silence them
gradlew -PXlint:none build
The below command activates a gradle plugin (OWASP) and Identifies and reportsknown vulnerabilities (CVEs) in OFBiz library dependencies. The task takes timeto complete, and once done, a report will be generated in$OFBIZ_HOME/build/reports/dependency-check-report.html
gradlew -PenableOwasp dependencyCheckAnalyze
Setting up OFBiz on eclipse is done by simply running the below command and thenimporting the project to eclipse. This command will generate the necessary.classpath and.project files for eclipse and it will also make the sourcecode for external libraries available in eclipse (i.e. you can view sourcethrough Ctrl + Click)
The first time you run this command it will take a long time to execute becauseit will download source packages available for project dependencies.
gradlew eclipse
In order to deploy OFBiz on a target system and in particular in a productionenvironment without requiring the target system to download Gradle and OFBizdependencies from the internet, it is possible to generate an archive bundlingOFBiz with all the Jars it depends on as atar
archive
gradlew distTar
or as azip
archive.
gradlew distZip
Those archives are available in thebuild/distributions
directory. To runOFBiz from those archive you must first unarchive them withtar xf
orunzip
and then from that directory you can run eitherbin/ofbiz
shell script orbin/ofbiz.bat
batch script with the appropriate ofbiz options.
OFBiz provides an extension mechanism through plugins. Plugins are standardOFBiz components that reside in the plugins directory. Plugins can be addedmanually or fetched from a maven repository. The standard tasks for managingplugins are listed below.
Note: OFBiz plugin versions followSemantic Versioning2.0.0
Download a plugin with all its dependencies (plugins) and install themone-by-one starting with the dependencies and ending with the plugin itself.
gradlew pullPlugin -PdependencyId="org.apache.ofbiz.plugin:myplugin:0.1.0"
If the plugin resides in a custom maven repository (not jcenter or localhost)then you can use specify the repository using below command:
gradlew pullPlugin -PrepoUrl="http://www.example.com/custom-maven" -PdependencyId="org.apache.ofbiz.plugin:myplugin:0.1.0"
If you need username and password to access the custom repository:
gradlew pullPlugin -PrepoUrl="http://www.example.com/custom-maven" -PrepoUser=myuser -PrepoPassword=mypassword -PdependencyId="org.apache.ofbiz.plugin:myplugin:0.1.0"
Download an official plugin from source control and place it in the plugins directory.It’s able to handle branches switches
Important | You need to use the last Git version, at least a 2.26 version |
MS Windows:pullPluginSource example
Unix-like OS:./pullPluginSource.sh example
Download all officially supported plugins from source control and place them in /plugins.It’s able to handle branches switches
Caution | This task deletes the /plugins directory and replaces it with the official plugins. |
Important | You need to use the last Git version, at least a 2.26 version |
MS Windows:pullAllPluginsSource
Unix-like OS:./pullAllPluginsSource.sh
If you have a plugin called mycustomplugin and want to install it in OFBizfollow the below instructions:
Extract the plugin if it is compressed
Place the extracted directory into /plugins
Run the below command
gradlew installPlugin -PpluginId=myplugin
The above commands executes the task "install" in the plugin’s build.gradle fileif it exists
If you have an existing plugin called mycustomplugin and you wish to uninstallrun the below command
gradlew uninstallPlugin -PpluginId=myplugin
The above command executes the task "uninstall" in the plugin’s build.gradlefile if it exists
CallsuninstallPlugin on an existing plugin and then delete it from thefile-system
gradlew removePlugin -PpluginId=myplugin
Create a new plugin. The following project parameters are passed:
pluginId: mandatory
pluginResourceName: optional, default is the Capitalized value of pluginId
webappName: optional, default is the value of pluginId
basePermission: optional, default is the UPPERCASE value of pluginId
gradlew createPlugin -PpluginId=myplugin
gradlew createPlugin -PpluginId=myplugin -PpluginResourceName=MyPlugin -PwebappName=mypluginweb -PbasePermission=MYSECURITY
The above command creates a new plugin in /plugins/myplugin
This task publishes an OFBiz plugin into a maven package and then uploads it toa maven repository. Currently, pushing is limited to localhost maven repository(work in progress). To push a plugin the following parameters are passed:
pluginId: mandatory
groupId: optional, defaults to org.apache.ofbiz.plugin
pluginVersion: optional, defaults to 0.1.0-SNAPSHOT
pluginDescription: optional, defaults to "Publication of OFBiz plugin${pluginId}"
gradlew pushPlugin -PpluginId=myplugin
gradlew pushPlugin -PpluginId=mycompany -PpluginGroup=com.mycompany.ofbiz.plugin -PpluginVersion=1.2.3 -PpluginDescription="Introduce special functionality X"
OFBiz is split into two repositories:
ofbiz-framework: Contains the core framework and main applications in thesystem like accounting, party, order, etc
ofbiz-plugins: Renamed from "special-purpose" and contains optionalcomponents that are officially supported by the community
Furthermore, the hot-deploy directory is removed as the plugins directory worksas a replacement for both "special-purpose" and "hot-deploy".
If you need to load the components in the plugins directory in a specific orderplace a component-load.xml file in the plugins directory listing the order.
To check out a plugin from source control use the Windows or Unix-likepullPluginSource script.To check out all plugins from source control use thepullAllPluginsSource script.Beware this deletes a previously existing pluginsdirectory.
OFBiz must run with an internet connection thefirst time it is prepared onthe system because it needs to download all the required dependencies.
After preparing OFBiz the first time correctly, it is possible to run OFBizwithout an internet connection by using the--offline
command line switchwhich tells Gradle to fetch its dependencies from the cache.
If any dependencies are missing from the cache and you pass--offline
switchthen the build execution will fail.
To setup an external database instead of the default embedded Apache Derby, youwill need to follow the following instructions:
Find the JDBC driver suitable for your database using one of the followingoptions:
Search for the JDBC driver injcenter andplace it in build.gradle dependencies e.g.
runtime 'mysql:mysql-connector-java:8.0.30'
OR
Download the JDBC driver jar and place it in $OFBIZ_HOME/lib or the libsub-directory of any component
Modify the entityengine.xml file located in$OFBIZ_HOME/framework/entity/config to switch the default database to the oneyou selected. For more details you can read the relevant section in thetechnicalsetup guide
To get tab completion (auto complete gradle commands by pressing tab) you candownload the script from the below link and place it in the appropriate locationfor your system.
For example, on debian based systems, you can use the following command:
sudo curl -L -shttps://edub.me/gradle-completion-bash -o /etc/bash_completion.d/gradle-tab-completion.bash
This distribution includes cryptographic software. The country in which youcurrently reside may have restrictions on the import, possession, use, and/orre-export to another country, of encryption software. BEFORE using anyencryption software, please check your country’s laws, regulations and policiesconcerning the import, possession, or use, and re-export of encryption software,to see if this is permitted. Seehttp://www.wassenaar.org/ for more information.
The U.S. Government Department of Commerce, Bureau of Industry and Security(BIS), has classified this software as Export Commodity Control Number (ECCN)5D002.C.1, which includes information security software using or performingcryptographic functions with asymmetric algorithms. The form and manner of thisApache Software Foundation distribution makes it eligible for export under theLicense Exception ENC Technology Software Unrestricted (TSU) exception (see theBIS Export Administration Regulations, Section 740.13) for both object code andsource code.
The following provides more details on the included cryptographic software:
Various classes in OFBiz, including DesCrypt, HashCrypt, and BlowFishCrypt uselibraries from the Sun Java JDK API including java.security.* and javax.crypto.*(the JCE, Java Cryptography Extensions API)
Other classes such as HttpClient and various related ones use the JSSE (JavaSecure Sockets Extension) API
About
Apache OFBiz is an open source product for the automation of enterprise processes. It includes framework components and business applications for ERP, CRM, E-Business/E-Commerce, Supply Chain Management and Manufacturing Resource Planning. OFBiz provides a foundation and starting point for reliable, secure and scalable enterprise solutions.