Build dependencies on OfBiz code for new plugin

2023-08-14 Thread Carsten Schinzer
Hello all,


While I feel this must be a very very basic question, I obviously do not find 
the right search statement to spot any solution on the web. Hum. So apologies 
for the spam if this is for you ,-)
I shall be happy to take any pointer to further reading or to example code for 
this in order to do 'homework' offline.

Context and objective:
I do try to build a standalone component for inclusion as a plugin into the 
OfBiz framework. I initialized the component using the framework’s Gradle task, 
then copied only the contents of the plugin folder over into a dedicated 
repository as my idea is to keep the code repo slim while then doing the 
component integration in a CICD pipeline that will finally produce a docker 
image that includes the component.

Integration steps in the pipeline:
My attempt to build (and then test) the component is the following:
- download the ofbiz framework from repository by cloning release22.01 from git
- create the plugin directory and copy my component code into it
- switch to ofbiz-framework folder and execute ./gradlew build

The issue:
When attempting to build, everything goes smoothly down to
Task :plugins:cdc-tickets:compileJava

where obviously the ofbiz packages are not found. Error message when compiling 
my classes in the component is this:
error: package org.apache.ofbiz.base.util does not exist

My question is:
- am I missing something in the build.gradle? A dependency statement maybe?

I tried with a dependency on the main project (as classpath project (':ofbiz‘), 
but that did not work out.
I checked most of the build.gradle configs in other plugins, but none mentions 
the dependency on ofbiz explicitly it appears; maybe I misread?
Is my approach even correct? It is based on Dan Watford's docker image project 
for OfBiz, so maybe not suited well for the component integration.
I also found nothing explicit in the OfBiz developer handbook or confluence 
space either.

So if you can point me: Many many thanks in advance!

If you want to throw an eye on the code, let me please know you gitlab user id, 
so I can grant you read access.

Warm regards


Carsten



Re: Build dependencies on OfBiz code for new plugin

2023-08-15 Thread Michael Brohl

Hi Carsten,

hard to say without seeing what's in your plugin.

Integration of plugins is straightforward. You can even make a symlink 
to an external plugin repo and it normally works.


It sounds like everything is setup ok, the plugin code can be found. 
Does compilation work if you don't have the plugin code under /plugins?


Everything else under /plugins except you plugin folder (the plugin 
needs a separate folder, e.g. /plugins/my-plugin/)?


Maybe you can post the relevant part of the console.log to see more.

Best regards,

Michael Brohl

ecomify GmbH - www.ecomify.de


Am 14.08.23 um 18:29 schrieb Carsten Schinzer:

Hello all,


While I feel this must be a very very basic question, I obviously do not find 
the right search statement to spot any solution on the web. Hum. So apologies 
for the spam if this is for you ,-)
I shall be happy to take any pointer to further reading or to example code for 
this in order to do 'homework' offline.

Context and objective:
I do try to build a standalone component for inclusion as a plugin into the 
OfBiz framework. I initialized the component using the framework’s Gradle task, 
then copied only the contents of the plugin folder over into a dedicated 
repository as my idea is to keep the code repo slim while then doing the 
component integration in a CICD pipeline that will finally produce a docker 
image that includes the component.

Integration steps in the pipeline:
My attempt to build (and then test) the component is the following:
- download the ofbiz framework from repository by cloning release22.01 from git
- create the plugin directory and copy my component code into it
- switch to ofbiz-framework folder and execute ./gradlew build

The issue:
When attempting to build, everything goes smoothly down to
Task :plugins:cdc-tickets:compileJava

where obviously the ofbiz packages are not found. Error message when compiling 
my classes in the component is this:
error: package org.apache.ofbiz.base.util does not exist

My question is:
- am I missing something in the build.gradle? A dependency statement maybe?

I tried with a dependency on the main project (as classpath project (':ofbiz‘), 
but that did not work out.
I checked most of the build.gradle configs in other plugins, but none mentions 
the dependency on ofbiz explicitly it appears; maybe I misread?
Is my approach even correct? It is based on Dan Watford's docker image project 
for OfBiz, so maybe not suited well for the component integration.
I also found nothing explicit in the OfBiz developer handbook or confluence 
space either.

So if you can point me: Many many thanks in advance!

If you want to throw an eye on the code, let me please know you gitlab user id, 
so I can grant you read access.

Warm regards


Carsten




Re: Build dependencies on OfBiz code for new plugin

2023-08-17 Thread Carsten Schinzer
Hi Michael,


Thanks to have a look and respond.
Here is the console output that a gives me trouble:

$ ./gradlew build
190 
Welcome 
to Gradle 7.6!
191 Here 
are the highlights of this release:
192  - 
Added support for Java 19.
193  - 
Introduced `--rerun` flag for individual task rerun.
194  - 
Improved dependency block for test suites to be strongly typed.
195  - 
Added a pluggable system for Java toolchains provisioning.
196 For 
more details see https://docs.gradle.org/7.6/release-notes.html
197 
Starting 
a Gradle Daemon (subsequent builds will be faster)
198 > 
Task :buildSrc:extractPluginRequests
199 > 
Task :buildSrc:generatePluginAdapters
200 > 
Task :buildSrc:compileJava
201 > 
Task :buildSrc:compileGroovy NO-SOURCE
202 > 
Task :buildSrc:compileGroovyPlugins
203 > 
Task :buildSrc:pluginDescriptors
204 > 
Task :buildSrc:processResources
205 > 
Task :buildSrc:classes
206 > 
Task :buildSrc:jar
207 > 
Task :buildSrc:assemble
208 > 
Task :buildSrc:compileTestJava NO-SOURCE
209 > 
Task :buildSrc:compileTestGroovy NO-SOURCE
210 > 
Task :buildSrc:pluginUnderTestMetadata
211 > 
Task :buildSrc:processTestResources NO-SOURCE
212 > 
Task :buildSrc:testClasses UP-TO-DATE
213 > 
Task :buildSrc:test NO-SOURCE
214 > 
Task :buildSrc:validatePlugins
215 > 
Task :buildSrc:check
216 > 
Task :buildSrc:build
217 > 
Task :compileJava
218 
/builds/dcs-ofbiz/cdc-ofbiz-tickets/ofbiz-framework/framework/common/src/main/java/org/apache/ofbiz/common/authentication/AuthHelper.java:132:
 warning: [removal] AccessController in java.security has been deprecated and 
marked for removal
219  
   return AccessController.doPrivileged(
220  
  ^
221 1 
warning
222 > 
Task :compileGroovy
223 > 
Task :processResources
224 > 
Task :themes:common-theme:nodeSetup
225 > 
Task :themes:common-theme:npmSetup SKIPPED
226 > 
Task :themes:common-theme:npmInstall
227 
added 8 
packages, and audited 9 packages in 910ms
228 
found 0 
vulnerabilities
229 > 
Task :classes
230 > 
Task :jar
231 > 
Task :startSc