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
Jacques Le Roux ddc238a49d Fixed: Bug in HtmlFormMacroLibrary.ftl::makeHyperlinkString macro (OFBIZ-12468)
Fixes a typo I already fixed in trunk but forgot in demo
2021-12-19 10:29:21 +01:00
Jacques Le Roux 4cff613b18 Fixed: [SECURITY] CVE-2021-45105: Apache Log4j2 (OFBIZ-12470)
The configuration seems to have changed.

log4j-slf4j18-impl available in Maven as 2.16.0 is not in 2.17.0.
Also log4j-web is now needed. In R18 as compile when in trunk as readonly...

I was guided by this block in console.log of trunk demo:
Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/util/SetUtils
	at org.apache.logging.log4j.web.Log4jWebInitializerImpl.getConfigURI(Log4jWebInitializerImpl.java:196)
	at org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:175)
	at org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:112)
	at org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5219)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)

I'll dbl-check why, notably about log4j-slf4j18-impl.
At least it works well like that.
2021-12-19 08:59:42 +01:00
Jacques Le Roux 4442c2adca Fixed: [SECURITY] CVE-2021-45105: Apache Log4j2 (OFBIZ-12470)
CVE-2021-45105: Apache Log4j2 versions 2.0-alpha1 through 2.16.0 does not protect
from uncontrolled recursion from self-referential lookups. This allows an
attacker with control over Thread Context Map data to cause a denial of service
when a crafted string is interpreted.
This issue is fixed in Log4j 2.17.0.:
https://logging.apache.org/log4j/2.x/security.html
2021-12-19 03:30:49 +01:00
Jacques Le Roux 80262418fd Fixed: Bug in HtmlFormMacroLibrary.ftl::makeHyperlinkString macro (OFBIZ-12468)
I was unable to reproduce the error, but according to
https://stackoverflow.com/questions/51524640/why-does-freemarkers-built-in-is-string-return-true-for-an-object
The solution is to check for targetParameters not being an hash

Actually this was not the reason of the 1.7GB console log, another Jira to come
2021-12-18 11:48:21 +01:00
Jacques Le Roux a48938982d Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
Comment out the XMLRPC tests. This alone should allow Buildbot 3.2 to run the
integration tests.

Conflict handled by hand
2021-12-16 07:11:01 +01:00
Jacques Le Roux 901ca14f44 Improved: no functional change, update /lib/README to use Maven search 2021-12-16 06:52:26 +01:00
Jacques Le Roux a42ea2bdb4 Improved: no functional change, link to Gradle and CodeQl workflows were wrong in badge
This allows now users to get directly to these workflows by clicking on the icon
2021-12-16 06:47:29 +01:00
Jacques Le Roux e2026b6a50 Improved: no functional change, link to repo was wrong in badge
This allows now users to get directly to the repo by clicking on the icon
2021-12-15 17:11:41 +01:00
Jacques Le Roux e83559d151 Improved: Apache Log4j2 (OFBIZ-12449)
Updates log4j2 from 2.15.0 to 2.16.0 because of
https://lists.apache.org/thread/d6v4r6nosxysyq9rvnr779336yf0woz4

It's not a security issue, I lazily use OFBIZ-12449 because it can improve
security even if it's not necessary (dixit the announce)
2021-12-14 12:29:32 +01:00
8 changed files with 53 additions and 41 deletions
+17 -20
View File
@@ -20,15 +20,15 @@ under the License.
= Apache OFBiz®
image:https://img.shields.io/badge/License-Apache%202.0-blue.svg[link=http://www.apache.org/licenses/LICENSE-2.0]
image:https://img.shields.io/badge/Version-release18.12-green.svg[link=Version]
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/badge.svg?branch=release18.12]
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/badge.svg?branch=release18.12]
image:https://qpkb254zxeu.montastic.io/badge[link=https://qpkb254zxeu.montastic.io]
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://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 -9
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,13 +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.15.0' // the API of log4j 2
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'
@@ -231,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.15.0' // for external jars using the old log4j1.2: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-core:2.15.0' // the implementation of the log4j 2 API
runtime 'org.apache.logging.log4j:log4j-jul:2.15.0' // for external jars using the java.util.logging: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-slf4j-impl:2.15.0' // for external jars using slf4j: routes logging to log4j 2
runtime 'org.apache.logging.log4j:log4j-jcl:2.15.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
+3 -2
View File
@@ -67,10 +67,11 @@ under the License.
<entity-xml action="assert" entity-xml-url="component://service/testdef/data/ServiceEcaGlobalEventAssertData.xml"/>
</test-case>
<test-case case-name="service-xml-rpc">
<!-- This alone should allow Buildbot 3.2 to run the integration tests, cf OFBIZ-12456 -->
<!-- <test-case case-name="service-xml-rpc">
<junit-test-suite class-name="org.apache.ofbiz.service.test.XmlRpcTests"/>
</test-case>
<test-case case-name="service-xml-rpc-local-engine">
<service-test service-name="testXmlRpcClientAdd"/>
</test-case>
</test-case!-->
</test-suite>
+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';`\""\"" "
+1 -1
View File
@@ -3,4 +3,4 @@ Place your custom jar files in here.
If you want to use a public open source library, it is recommended
that you do not place the library in here. Instead declare it as a
dependency in your build scripts (build.gradle files) by finding the
appropriate library in jcenter (https://bintray.com/bintray/jcenter)
appropriate library in Maven (https://search.maven.org/)
@@ -695,7 +695,7 @@ Parameter: delegatorName, String, optional - name of the delegator in context.
<#macro makeHyperlinkString hiddenFormName imgSrc title alternate linkUrl description linkStyle="" event="" action="" targetParameters="" targetWindow="" confirmation="" uniqueItemName="" height="" width="" id="">
<#if uniqueItemName?has_content>
<#local params = "{&quot;presentation&quot;: &quot;layer&quot;">
<#if targetParameters?has_content>
<#if targetParameters?has_content && !targetParameters?is_hash>
<#local parameterMap = targetParameters?eval>
<#local parameterKeys = parameterMap?keys>
<#list parameterKeys as key>