Author SHA1 Message Date
Jacques Le Roux 71c853fe82 Documented: no reason to have a "+" there, on same line is OK
Also to test RAT for stable again (weird it did not work last time)
2022-01-01 18:24:09 +01:00
Jacques Le Roux 7809b73583 Improved: README.PDF is not generated by BuildBot nor locally (OFBIZ-12476)
This only adds pending changes for PDF files and add a link to HTML files
Also allows to test new stable RAT BuildBot build
2022-01-01 13:13:47 +01:00
Jacques Le Roux 61c28602c2 Documented: misc. trivial updates in README.adoc
Notably removes reference to SVN
Updates link to README no longer on site but on https://nightlies.apache.org/ofbiz/
2021-12-31 08:17:50 +01:00
Jacques Le Roux 90d93d5e99 Documented: just adds a sub-title about clean and add data (as in trunk)
==== Clean system and load the complete OFBiz data
2021-12-30 20:59:34 +01:00
Jacques Le Roux 87eb402bcd Improved: add information about paths in Windows (no spaces in path for JDK) 2021-12-30 14:27:44 +01:00
Jacques Le Roux 015f60f982 Improved: Removes montastic badge, it does not reflect the reality 2021-12-30 10:44:53 +01:00
Jacques Le Roux 9020f03390 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (removes a space in VERSION file) to check last changes in new
Buildbot config.

I think I found the syntax issue, let's see
2021-12-29 19:13:22 +01:00
Jacques Le Roux dc9d71fe3b Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
No functional change (adds a space in VERSION file) to check last changes in new
Buildbot config.

It seems there is a syntax issue somewhere...
2021-12-29 19:04:30 +01:00
Jacques Le Roux d38ff24cf3 Improved: suppresses 2 warnings related to deprecated CSVFormat.DEFAULT.withHeader()
InvoiceServices merge "did not went well"
2021-12-29 18:36:30 +01:00
Jacques Le Roux c4088961d3 Improved: suppresses 2 warnings related to deprecated CSVFormat.DEFAULT.withHeader()
This was not done correctly last time (previous commit e4d4329)
2021-12-29 08:58:49 +01:00
Jacques Le Roux 9853d10bd9 Improved: suppresses 2 warnings related to deprecated CSVFormat.DEFAULT.withHeader()
Also adds a try-with-ressource in InvoiceServices::importInvoice to properly
close csvReader on returns. Hence removes an useless csvReader.close().

Several comments about Eclipse giving wrong advice
<<Resource leak: '<unassigned Closeable value>' is not closed at this location>>
It's OK, we are inside try-with-ressources.

Finally removes a redundant final in PartyServices::importParty

Conflicts in InvoiceServices.java handled by hand
2021-12-29 08:58:39 +01:00
Jacques Le Roux 5b6e427f24 Fixed: [SECURITY] CVE-2021-44832: Apache Log4j2 (OFBIZ-12475)
See complete explanation at https://issues.apache.org/jira/browse/OFBIZ-12475
2021-12-29 08:53:50 +01:00
Jacques Le Roux 0d8de91657 Fixed: Gradle Wrapper is not downloaded with 18.12.03 (OFBIZ-12471)
I guess for a reason David misses the path to WindowsPowerShell as an
environment variable.

Follows advice here:
https://stackoverflow.com/questions/29778121/powershell-is-not-recognized-as-an-internal-or-external-command-operable-progr

Thanks: David S Hunter for report
2021-12-26 14:55:57 +01:00
Jacques Le Roux e5b5075126 Fixed: [SECURITY] Update TIka because of Apache Log4j2 vulnerability (OFBIZ-12474)
Apache Tika 1.28 contains a migration to log4j2 (2.17.0) from log4j
as well as several other dependency upgrades. Details can be found in
the changes file:
https://www.apache.org/dist/tika/1.28/CHANGES-1.28.txt
2021-12-24 08:15:19 +01:00
Jacques Le Roux 99441469dc Fixed: CheckStyleMain Task is Failing in 18.12.04 (OFBIZ-12473)
On Windows checkstyle reports that it misses a NewLine at EOF for all files, not
on *nix

Currently:
1. We don't care about checkstyle in branches (we will in 22.01 where it'll 0 errors)
2. Proof is we check for 38802 but the errors are actually 38508 in *nix

Solution: change from 38802 to 39638 to pass also on Windows

Thanks: David S Hunter for report
2021-12-22 17:29:57 +01:00
5 changed files with 45 additions and 35 deletions
+14 -17
View File
@@ -23,12 +23,12 @@ image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[link=http://www
image:https://img.shields.io/badge/Version-release18.12-green.svg[link=https://github.com/apache/ofbiz-framework/tree/release18.12]
image:https://github.com/apache/ofbiz-framework/actions/workflows/gradle.yaml/badge.svg?branch=release18.12[link=https://github.com/apache/ofbiz-framework/actions/workflows/gradle.yaml]
image:https://github.com/apache/ofbiz-framework/actions/workflows/codeql-analysis.yml/badge.svg?branch=release18.12[link=https://github.com/apache/ofbiz-framework/actions/workflows/codeql-analysis.yml]
image:https://qpkb254zxeu.montastic.io/badge[link=https://qpkb254zxeu.montastic.io]
//image:https://sonarcloud.io/api/project_badges/measure?project=apache_ofbiz-framework&metric=alert_status&branch=release18.12[link=notReadyYet]
If you are reading this file in AsciiDoc format you may want to see it in
https://ci.apache.org/projects/ofbiz/site/next/readme/html5/README.html[HTML]
or https://ci.apache.org/projects/ofbiz/site/next/readme/pdf/README.pdf[PDF] format
https://nightlies.apache.org/ofbiz/stable/readme/html5/[HTML]
//or https://nightlies.apache.org/ofbiz/stable/readme/pdf/[HTML] +[PDF] format Not Ready Yet see
or https://ci.apache.org/projects/ofbiz/site/stable/readme/pdf/README.pdf[PDF] format
---
@@ -71,8 +71,14 @@ The only requirements to run OFBiz is
* to have the Java Development Kit (JDK) version 8 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. +
__________________________________________________________________________________________________________________________________________
_Note_: Warning: on Windows don't put OFBiz in a directory with space/s in the path.
__________________________________________________________________________________________________________________________________________
https://adoptopenjdk.net/[JDK download], https://medium.com/@javachampions/java-is-still-free-2-0-0-6b9aa8d6d244[To know more about the JDK]
* If on Windows, a Powershell version >= 7.1.3 installed that you can download from the below link. +
https://github.com/PowerShell/PowerShell[Powershell]
@@ -95,6 +101,7 @@ Unix-like OS: `./gradle/init-gradle-wrapper.sh`
[[prepare-ofbiz]]
=== Prepare OFBiz:
==== Clean system and load the complete OFBiz data
_________________________________________________________________________________________________________________________________________________________________________________________________________________
_Note_: Depending on your Internet connection speed it might take a long time
for this step to complete if you are using OFBiz for the first time as it needs
@@ -649,9 +656,8 @@ If you need username and password to access the custom repository:
[[pull-an-official-plugin-from-source-control]]
=== Pull an official plugin from source control
Download an official plugin from source control (currently subversion) and place
it in the plugins directory. In addition, this task also executes the "install"
task if it is defined for the plugin being downloaded.
Download an official plugin from source control and place it in the plugins directory.
In addition, this task also executes the "install" task if it is defined for the plugin being downloaded.
This task is mostly useful when working on the trunk branch as it pulls in the
latest version of a plugin.
@@ -659,15 +665,11 @@ latest version of a plugin.
`gradlew pullPluginSource -PpluginId=ecommerce`
________________________________________________________________________________________
_Note_: This plugin will have its own .svn directory placed inside the plugin
directory.
________________________________________________________________________________________
[[pull-all-official-plugins-from-source-control]]
=== Pull all official plugins from source control
Download all officially supported plugins from source control (currently
subversion) and place them inclusive of their ".svn" directory in /plugins.
subversion) and place them in /plugins.
WARNING! This task deletes the /plugins directory and replaces it with the
official plugins.
@@ -679,11 +681,6 @@ not recommend using this task on releases of OFBiz, instead consider using the
"pullPlugin" task to get the correct version of a plugin compatible with your
release.
____________________________________________________________________________________
_Note_: All the plugins will share a .svn directory placed in the plugins
directory.
____________________________________________________________________________________
[[install-a-plugin]]
=== Install a plugin
@@ -37,6 +37,7 @@ import java.util.Map.Entry;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVFormat.Builder;
import org.apache.commons.csv.CSVRecord;
import org.apache.ofbiz.accounting.payment.PaymentGatewayServices;
import org.apache.ofbiz.accounting.payment.PaymentWorker;
@@ -3552,8 +3553,8 @@ public class InvoiceServices {
String organizationPartyId = (String) context.get("organizationPartyId");
String encoding = System.getProperty("file.encoding");
String csvString = Charset.forName(encoding).decode(fileBytes).toString();
final BufferedReader csvReader = new BufferedReader(new StringReader(csvString));
CSVFormat fmt = CSVFormat.DEFAULT.withHeader();
Builder csvFormatBuilder = Builder.create().setHeader();
CSVFormat fmt = csvFormatBuilder.build();
List<String> errMsgs = new LinkedList<>();
List<String> newErrMsgs;
String lastInvoiceId = null;
@@ -3561,7 +3562,7 @@ public class InvoiceServices {
String newInvoiceId = null;
int invoicesCreated = 0;
try {
try (BufferedReader csvReader = new BufferedReader(new StringReader(csvString))) {
for (final CSVRecord rec : fmt.parse(csvReader)) {
currentInvoiceId = rec.get("invoiceId");
if (lastInvoiceId == null || !currentInvoiceId.equals(lastInvoiceId)) {
@@ -3626,11 +3627,18 @@ public class InvoiceServices {
try {
invoiceResult = dispatcher.runSync("createInvoice", invoice);
if (ServiceUtil.isError(invoiceResult)) {
// Eclipse reports here: Resource leak: '<unassigned Closeable value>' is not closed at this location
// but it's OK. As csvReader is in a try-with-ressource it will be closed anyway
// I prefer to not put @SuppressWarnings("resource") to the whole method
// BTW to be consistent Eclipse should also reports the same issue in PartyService (see there)
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(invoiceResult));
}
} catch (GenericServiceException e) {
csvReader.close();
Debug.logError(e, module);
// Eclipse reports here: Resource leak: '<unassigned Closeable value>' is not closed at this location
// but it's OK. As csvReader is in a try-with-ressource it will be closed anyway
// I prefer to not put @SuppressWarnings("resource") to the whole method
// BTW to be consistent Eclipse should also reports the same issue in PartyService (see there)
return ServiceUtil.returnError(e.getMessage());
}
newInvoiceId = (String) invoiceResult.get("invoiceId");
@@ -3685,10 +3693,13 @@ public class InvoiceServices {
try {
Map<String, Object> result = dispatcher.runSync("createInvoiceItem", invoiceItem);
if (ServiceUtil.isError(result)) {
// Eclipse reports here: Resource leak: '<unassigned Closeable value>' is not closed at this location
// but it's OK. As csvReader is in a try-with-ressource it will be closed anyway
// I prefer to not put @SuppressWarnings("resource") to the whole method
// BTW to be consistent Eclipse should also reports the same issue in PartyService (see there)
return ServiceUtil.returnError(ServiceUtil.getErrorMessage(result));
}
} catch (GenericServiceException e) {
csvReader.close();
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
@@ -34,6 +34,7 @@ import java.util.Locale;
import java.util.Map;
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVFormat.Builder;
import org.apache.commons.csv.CSVRecord;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilDateTime;
@@ -2326,7 +2327,8 @@ public class PartyServices {
ByteBuffer fileBytes = (ByteBuffer) context.get("uploadedFile");
String encoding = System.getProperty("file.encoding");
String csvString = Charset.forName(encoding).decode(fileBytes).toString();
CSVFormat fmt = CSVFormat.DEFAULT.withHeader();
Builder csvFormatBuilder = Builder.create().setHeader();
CSVFormat fmt = csvFormatBuilder.build();
List<String> errMsgs = new LinkedList<>();
List<String> newErrMsgs = new LinkedList<>();
String lastPartyId = null; // last partyId read from the csv file
@@ -2356,7 +2358,7 @@ public class PartyServices {
try (BufferedReader csvReader = new BufferedReader(new StringReader(csvString))) {
for (final CSVRecord rec : fmt.parse(csvReader)) {
for (CSVRecord rec : fmt.parse(csvReader)) {
if (UtilValidate.isNotEmpty(rec.get("partyId"))) {
currentPartyId = rec.get("partyId");
}
+10 -10
View File
@@ -82,7 +82,7 @@ checkstyle {
// the sum of errors that were present before introducing the
// ‘checkstyle’ tool present in the framework and in the official
// plugins.
maxErrors = 38802
maxErrors = 39638
// Currently there are a lot of errors so we need to temporarily
// hide them to avoid polluting the terminal output.
showViolations = false
@@ -190,14 +190,14 @@ dependencies {
compile 'org.apache.geronimo.components:geronimo-transaction:3.1.4'
compile 'org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1'
compile 'org.apache.httpcomponents:httpclient-cache:4.5.6'
compile 'org.apache.logging.log4j:log4j-api:2.17.0' // the API of log4j 2
compile 'org.apache.logging.log4j:log4j-web:2.17.0' //???
compile 'org.apache.logging.log4j:log4j-api:2.17.1' // the API of log4j 2
compile 'org.apache.logging.log4j:log4j-web:2.17.1' //???
compile 'org.apache.poi:poi:3.17'
compile 'org.apache.pdfbox:pdfbox:2.0.24'
compile 'org.apache.shiro:shiro-core:1.4.0'
compile 'org.apache.sshd:sshd-core:1.7.0'
compile 'org.apache.tika:tika-core:1.26'
compile 'org.apache.tika:tika-parsers:1.26'
compile 'org.apache.tika:tika-core:1.28'
compile 'org.apache.tika:tika-parsers:1.28'
compile 'org.apache.tomcat:tomcat-catalina-ha:9.0.54'
compile 'org.apache.tomcat:tomcat-catalina:9.0.54'
compile 'org.apache.tomcat:tomcat-jasper:9.0.54'
@@ -232,11 +232,11 @@ dependencies {
runtime 'org.apache.axis2:axis2-transport-local:1.7.8'
runtime 'org.apache.derby:derby:10.14.2.0'
runtime 'org.apache.geronimo.specs:geronimo-jaxrpc_1.1_spec:1.1'
runtime 'org.apache.logging.log4j:log4j-1.2-api:2.17.0' // for external jars using the old log4j1.2: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-core:2.17.0' // the implementation of the log4j 2 API
runtime 'org.apache.logging.log4j:log4j-jul:2.17.0' // for external jars using the java.util.logging: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.0' // for external jars using slf4j: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-jcl:2.17.0' // need to constrain to version to avoid classpath conflict (ReflectionUtil)
runtime 'org.apache.logging.log4j:log4j-1.2-api:2.17.1' // for external jars using the old log4j1.2: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-core:2.17.1' // the implementation of the log4j 2 API
runtime 'org.apache.logging.log4j:log4j-jul:2.17.1' // for external jars using the java.util.logging: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.1' // for external jars using slf4j: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-jcl:2.17.1' // need to constrain to version to avoid classpath conflict (ReflectionUtil)
runtime 'org.codeartisans.thirdparties.swing:batik-all:1.8pre-r1084380'
// plugin libs
+1 -1
View File
@@ -23,4 +23,4 @@ if exist "%~dp0gradle\wrapper\gradle-wrapper.jar" (
exit /b
)
pwsh -command " Start-Process pwsh -Verb RunAs \""-Command `\""cd '%cd%'; & 'gradle\init-gradle-wrapper.ps1';`\""\"" "
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\powershell.exe -command " Start-Process pwsh -Verb RunAs \""-Command `\""cd '%cd%'; & 'gradle\init-gradle-wrapper.ps1';`\""\"" "