How to deploy fragment to iDempiere instance?

1,364 views
Skip to first unread message

Anozi Mada

unread,
Jan 29, 2013, 5:45:16 AM1/29/13
to idem...@googlegroups.com
Hi,

I'm trying to custom java class that can't be edited by existing extensions.
So I create a fragment and it works well on eclipse.
Here is how I did it:
  • In the host plugin (in my case org.adempiere.base), add patch.jar to Bundle-ClassPath in MANIFEST.MF
  • Create new fragment and set the host plugin to org.adempiere.base then in build.properties rename the jar to patch.jar
  • Add the fragment to configuration (server.product/swingclient.product)
However I have no idea how to deploy it to iDempiere instance. In swing instance I copy the exported fragment jar to ${IDEMPIERE_HOME}/plugins and edit the file at ${IDEMPIERE_HOME}/configuration/config.ini and it works once but when I update the jar the change is not updated. In server instance it didn't work at all with that method.

Can somebody guide me or give me references about how to accomplish this?

Thank you

Anozi Mada

unread,
Jan 30, 2013, 3:29:47 AM1/30/13
to idem...@googlegroups.com
In server instance case it seems I forgot to put the fragment jar.
And to update fragment jar I guess you have to deploy it using different jar name so you have to update config.ini for every changes you make.
Now it runs just fine. Though I don't know if it's the proper way to update plugin fragment, because you have to restart the app server to see the changes.

Heng Sin Low

unread,
Jan 30, 2013, 4:32:11 AM1/30/13
to idem...@googlegroups.com
the recommended approach is to export your plugin project ( bundle, fragment or feature ) to a p2 repository ( see http://maksim.sorokin.dk/it/2010/11/26/creating-a-p2-repository-from-features-and-plugins/ ) and install it to your idempiere instance using the p2 director commands ( see the update.sh for reference. note that for feature, if your feature id is org.abc.myfeature then the installable name is org.abc.myfeature.feature.group ).

after the installation, you can access localhost:8080/osgi/system/console to verify ( need superuser id and password ).


--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Anozi Mada

unread,
Jan 31, 2013, 5:45:30 AM1/31/13
to idem...@googlegroups.com
It works on idempiere-server! Thank you.
In the end I use eclipse to generate the feature.
But I cannot update the adempiere-client using this method. The output shows no errors but my plugins is not installed. When I check the plugin folder my plugin is not there.
Does somebody experience the same things?

This is my code to update the adempiere-client:
cp adempiere-client.ini adempiere-client.ini.sav
java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination file:/opt/idempiere/adempiere-client/ -repository file:/opt/idempiere/p2/ -u test.idempiere.feature.group
java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination file:/opt/idempiere/adempiere-client/ -repository file:/opt/idempiere/p2/ -i test.idempiere.feature.group
cp adempiere-client.ini.sav adempiere-client.ini

And this is the output:
Uninstalling test.idempiere.feature.group 1.0.0.201301310949.
Operation completed in 2328 ms.
Installing test.idempiere.feature.group 1.0.0.201301310949.
Operation completed in 2510 ms.


After that a folder C:\Users\Anozi\buckminster.output\org.adempiere.ui.swing_1.0.0-eclipse.feature\adempiere.gtk.linux.x86_64\adempiere-client generated in /opt/idempiere/adempiere-client/ with my feature in it.

redhuan d. oon

unread,
Feb 1, 2013, 5:14:44 AM2/1/13
to idem...@googlegroups.com
I also cannot update adempiere-client. I used the direct 'install' from URI within the OSGi console. You can refer my forum post on AssetMaintenance plugin. (www.red1.org/adempiere)

hengsin

unread,
Feb 5, 2013, 11:15:06 AM2/5/13
to idem...@googlegroups.com
Fixed, see http://jira.idempiere.com/browse/IDEMPIERE-601

On Thursday, 31 January 2013 18:45:30 UTC+8, Anozi Mada wrote:

Anozi Mada

unread,
Feb 7, 2013, 3:15:27 AM2/7/13
to idem...@googlegroups.com
Thank you! I can update the swing client now.

Ivy Michels

unread,
Oct 8, 2013, 9:11:05 AM10/8/13
to idem...@googlegroups.com
Hi Anozi Mada,

i'm trying to get a similar approach to run, because I have some core classes that I want to modify and they are not supported by the extensions available.

i have two questions about the solution you presented: 

1 - is the patches.jar is external file included inside the fragment plugin?
2 - is the patches.jar the name of the fragment that you created bundle itself ?

If is the second, i'm not understanding the second step that you did:

Create new fragment and set the host plugin to org.adempiere.base then in build.properties rename the jar to patch.jar

My fragment build.properties just have this:
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
so, where do I have to change the name to patch.jar ?

Thank you!

Anozi Mada

unread,
Oct 9, 2013, 1:36:24 AM10/9/13
to idem...@googlegroups.com
Hi Ivy Michels,

I've attached the screenshot to make it more clear.
And the result would be:
bin.includes = META-INF/,\
               org.adempiere.base-fragment.jar
jars.compile.order = org.adempiere.base-fragment.jar
source.org.adempiere.base-fragment.jar = src/
output.org.adempiere.base-fragment.jar = bin/


The alternative method is to fork the iDempiere and change the core class directly so you won't need to create a fragment anymore.

Arthur Melo

unread,
May 16, 2016, 8:00:48 PM5/16/16
to iDempiere
Hi Anozi.
wiki idempiere have a topic of this patch approach?

Alan Lescano

unread,
May 18, 2016, 11:50:20 AM5/18/16
to idem...@googlegroups.com
Arthur,

JPiere is a great product based on iDempiere. Some links about the project:

The solution presented by Anozi is used in JPMS (JPiere Modifications). See the plugins in the repo.
More infos about configuring the core plugins, you can find here http://wiki.idempiere.org/en/JPiere_Development_environment_establishment

Alan

--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.

Arthur Melo

unread,
May 21, 2016, 2:38:42 PM5/21/16
to iDempiere
Alan, thanks for reply.
I analyzed this plugins jpiere.modification.
This plugins override the entire class, thats is, I need to copy the original class (with same original name) and make my changes but if LTS make a change on that class I'm overwriting the execution of code will be phased out. 
My ideal approach would be extend the class I want change, and override only the methods or fields I want. But I believe it is impossible without touch on LTS code.
thank you anyway

gue.s...@gmail.com

unread,
Feb 16, 2022, 2:40:59 AM2/16/22
to iDempiere
Hi all, 
Sorry for open again this old thread.
I try to create custom adempire.base using JPMS method. It was run in eclipse environment, then create feature project and install using p2.
My question, Since in JPMS method must modify manifest.mf in project org.adempiere.base, how I can update org.adempiere.base.jar in idempiere server?
Should I add org.adempiere.base.jar in my feature project?

Im using idempiere 5.1

Regards 
Shindu

Avian Driyanto

unread,
Sep 5, 2024, 11:52:26 PM9/5/24
to iDempiere
Does any one do this method with iDempiere 11 ? not only modify org.adempiere.base but also org.adempiere.ui.

Regards
Avian

Reply all
Reply to author
Forward
0 new messages