Discussion:
patching eclipse jars
(too old to reply)
Johan Compagner
2018-04-18 13:49:20 UTC
Permalink
Hi,

previously when we used the "target" dir that has an eclipse installation i
could just patch some eclipse jars to get some bugs out from then and build
a product against that target dir.

How to do that with tycho?

I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me

i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?

that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension point
but there can be only one of them
the doc says of AbstractHelpUI:

* Note that the standard implementation of the help system UI is provided
by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform can
only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to extend
this
* extension point.

yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide a
better impl of the HelpUI

Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my feature
would include that bumbed version)

Is there somehow a tycho property where i can say get this plugin always
from there?
(or that my local plugins are alway overwriting the once that come from p2
repositories)?


The other example is this bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819

i also kind of want to patch that myself, because no i have to wait for an
4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use that
patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
Felix Dorner
2018-04-18 14:04:46 UTC
Permalink
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse installation
i could just patch some eclipse jars to get some bugs out from then and
build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension point
but there can be only one of them
* Note that the standard implementation of the help system UI is provided
by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform can
only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to extend
this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide a
better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my feature
would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin always
from there?
(or that my local plugins are alway overwriting the once that come from p2
repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait for an
4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use that
patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Johan Compagner
2018-04-18 14:24:46 UTC
Permalink
so it is that featureToPatch entry i guess

But what to do in tycho for that is not really clear to me if i look at the
sample that bug has:

https://github.com/eclipse/eclipse.platform.releng.aggregator/blob/master/eclipse-platform-parent/pom.xml#L617

What should i create locally? I now just have the plugin
Should i also create the exact same feature?
Post by Felix Dorner
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse installation
i could just patch some eclipse jars to get some bugs out from then and
build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension point
but there can be only one of them
* Note that the standard implementation of the help system UI is
provided by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform
can only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to extend
this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide a
better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my feature
would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin always
from there?
(or that my local plugins are alway overwriting the once that come from
p2 repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait for
an 4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use that
patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
Felix Dorner
2018-04-18 15:05:18 UTC
Permalink
If I understand you, you want to replace a plugin in eclipse with a custom
built one, to fix a bug. You need a feature patch for this. Once you know
what that is, you can go and find out how to build one with tycho. You said
you did this before but without tycho, what build system did you use
before?

On Apr 18, 2018 4:25 PM, "Johan Compagner" <***@servoy.com> wrote:

so it is that featureToPatch entry i guess

But what to do in tycho for that is not really clear to me if i look at the
sample that bug has:

https://github.com/eclipse/eclipse.platform.releng.aggregator/blob/master/eclipse-platform-parent/pom.xml#L617

What should i create locally? I now just have the plugin
Should i also create the exact same feature?
Post by Felix Dorner
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse installation
i could just patch some eclipse jars to get some bugs out from then and
build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension point
but there can be only one of them
* Note that the standard implementation of the help system UI is
provided by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform can
only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to extend
this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide a
better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my feature
would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin always
from there?
(or that my local plugins are alway overwriting the once that come from
p2 repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait for
an 4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use that
patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
tycho-***@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Johan Compagner
2018-04-18 15:15:04 UTC
Permalink
i am not the only one with questions

https://bugs.eclipse.org/bugs/show_bug.cgi?id=389698#c11

i never used the feature patch feature...

Previously i just had a target folder (which was an eclipse version)
where i just copied over the patched jars. and eclipse p2 then created a
product from that install

i did follow now this:

http://wiki.eclipse.org/JDT_UI/Howto/Create_Feature_Patch

so i have a feature that looks like this:

<feature
id="org.eclipse.help.patch"
label="Help Patch"
version="1.0.0">
<requires>
<import feature="org.eclipse.help" version="2.2.103.v20180301-0715"
patch="true"/>
</requires>

<plugin
id="org.eclipse.help.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>


but what should i now do with that feature? i can't include it into my core
product feature because it then complains
Or should he version of my custom org.eclipse.help.ui be exactly the same
as the one i want to patch (inside the org.eclipse.help feature)
Post by Felix Dorner
If I understand you, you want to replace a plugin in eclipse with a custom
built one, to fix a bug. You need a feature patch for this. Once you know
what that is, you can go and find out how to build one with tycho. You said
you did this before but without tycho, what build system did you use
before?
so it is that featureToPatch entry i guess
But what to do in tycho for that is not really clear to me if i look at
https://github.com/eclipse/eclipse.platform.releng.aggregator/blob/master/
eclipse-platform-parent/pom.xml#L617
What should i create locally? I now just have the plugin
Should i also create the exact same feature?
Post by Felix Dorner
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse
installation i could just patch some eclipse jars to get some bugs out from
then and build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension point
but there can be only one of them
* Note that the standard implementation of the help system UI is
provided by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform
can only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to
extend this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide a
better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my feature
would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin always
from there?
(or that my local plugins are alway overwriting the once that come from
p2 repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait for
an 4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use that
patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
Johan Compagner
2018-04-18 16:08:39 UTC
Permalink
I have tried a few more things but with no luck

So the question remains what really needs to be configured.
Many things i find are all about a p2 build not tycho

So i have a plugin of eclipse "org.eclipse.help.ui" that i want to patch
(use my version)

that plugin is as far as i know a member of the feature "org.eclipse.help"

so i have my own " org.eclipse.help.ui" plugin project in my workspace
(besides all other plugins)
with the exact same version (i tried also others) as the plugin that i want
to override.

i make a patch feature project that requires that help feature.

add that plugin to that feature

But what to do then?

Should i include that patch feature in my main feature.xml?

Should i add stuff the the pom.xml of the product build?

i first create all the plugins and store them in my local repo

Then i make the 2 feature modules (my own and the patch feature) and then
i execute the product build

But the repository that is then assembled always have the eclipse plugin
not my plugin...

So what step do i miss here? How can i make sure that the plugin is
completely overwritten by mine?
i guess i need to have the same version right? else i break the eclipse
help feature.

johan
Post by Johan Compagner
i am not the only one with questions
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389698#c11
i never used the feature patch feature...
Previously i just had a target folder (which was an eclipse version)
where i just copied over the patched jars. and eclipse p2 then created a
product from that install
http://wiki.eclipse.org/JDT_UI/Howto/Create_Feature_Patch
<feature
id="org.eclipse.help.patch"
label="Help Patch"
version="1.0.0">
<requires>
<import feature="org.eclipse.help" version="2.2.103.v20180301-0715"
patch="true"/>
</requires>
<plugin
id="org.eclipse.help.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
but what should i now do with that feature? i can't include it into my
core product feature because it then complains
Or should he version of my custom org.eclipse.help.ui be exactly the
same as the one i want to patch (inside the org.eclipse.help feature)
Post by Felix Dorner
If I understand you, you want to replace a plugin in eclipse with a
custom built one, to fix a bug. You need a feature patch for this. Once you
know what that is, you can go and find out how to build one with tycho. You
said you did this before but without tycho, what build system did you use
before?
so it is that featureToPatch entry i guess
But what to do in tycho for that is not really clear to me if i look at
https://github.com/eclipse/eclipse.platform.releng.aggregato
r/blob/master/eclipse-platform-parent/pom.xml#L617
What should i create locally? I now just have the plugin
Should i also create the exact same feature?
Post by Felix Dorner
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse
installation i could just patch some eclipse jars to get some bugs out from
then and build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension
point but there can be only one of them
* Note that the standard implementation of the help system UI is
provided by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform
can only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to
extend this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide a
better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my feature
would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin
always from there?
(or that my local plugins are alway overwriting the once that come from
p2 repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait for
an 4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use that
patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
--
Johan Compagner
Servoy
Felix Dorner
2018-04-18 18:10:59 UTC
Permalink
It is basically a pita to do. If you read through the initial bug in my
first reply you will find an explanation for how the eclipse releng team
solves this for the beta Java x patches.
Post by Johan Compagner
I have tried a few more things but with no luck
So the question remains what really needs to be configured.
Many things i find are all about a p2 build not tycho
So i have a plugin of eclipse "org.eclipse.help.ui" that i want to patch
(use my version)
that plugin is as far as i know a member of the feature "org.eclipse.help"
so i have my own " org.eclipse.help.ui" plugin project in my workspace
(besides all other plugins)
with the exact same version (i tried also others) as the plugin that i
want to override.
i make a patch feature project that requires that help feature.
add that plugin to that feature
But what to do then?
Should i include that patch feature in my main feature.xml?
Should i add stuff the the pom.xml of the product build?
i first create all the plugins and store them in my local repo
Then i make the 2 feature modules (my own and the patch feature) and then
i execute the product build
But the repository that is then assembled always have the eclipse plugin
not my plugin...
So what step do i miss here? How can i make sure that the plugin is
completely overwritten by mine?
i guess i need to have the same version right? else i break the eclipse
help feature.
johan
Post by Johan Compagner
i am not the only one with questions
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389698#c11
i never used the feature patch feature...
Previously i just had a target folder (which was an eclipse version)
where i just copied over the patched jars. and eclipse p2 then created a
product from that install
http://wiki.eclipse.org/JDT_UI/Howto/Create_Feature_Patch
<feature
id="org.eclipse.help.patch"
label="Help Patch"
version="1.0.0">
<requires>
<import feature="org.eclipse.help" version="2.2.103.v20180301-0715"
patch="true"/>
</requires>
<plugin
id="org.eclipse.help.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
but what should i now do with that feature? i can't include it into my
core product feature because it then complains
Or should he version of my custom org.eclipse.help.ui be exactly the
same as the one i want to patch (inside the org.eclipse.help feature)
Post by Felix Dorner
If I understand you, you want to replace a plugin in eclipse with a
custom built one, to fix a bug. You need a feature patch for this. Once you
know what that is, you can go and find out how to build one with tycho. You
said you did this before but without tycho, what build system did you use
before?
so it is that featureToPatch entry i guess
But what to do in tycho for that is not really clear to me if i look at
https://github.com/eclipse/eclipse.platform.releng.aggregator/blob/master/eclipse-platform-parent/pom.xml#L617
What should i create locally? I now just have the plugin
Should i also create the exact same feature?
Post by Felix Dorner
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse
installation i could just patch some eclipse jars to get some bugs out from
then and build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension
point but there can be only one of them
* Note that the standard implementation of the help system UI is
provided by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the platform
can only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to
extend this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide
a better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my
feature would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin
always from there?
(or that my local plugins are alway overwriting the once that come
from p2 repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait
for an 4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use that
patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
Johan Compagner
2018-04-19 07:29:43 UTC
Permalink
problem with that is that almost all the urls in that second comment for
example are not working anymore
So there is not really an example, except that one that shows the parent.pom

I don't get why this is so hard to do..

The solution can be so simple, just let tycho for all the plugins that he
gathers to assemble the repository look first into the local repo's if it
is there, instead of getting it from the outside p2 repo.

So when i want to override 1 plugin i just clone that plugin in my local
workspace with that specific version, and build it locally and push it in
my local repo
then a product bulid just picks that one up..
We could even say if that scanning always first is taking to much time or
is harder to do that we can specify this in the tycho configuration that
this plugin should come from local repo (just like you can filter plugins)

I wonder if there is a simple live setup of git repo that has such a patch
with tycho.
I just can't find any good examples or just good documentation how to do
this

I am now going another way and trying to patch the assembled repository
just before it materializes the product, will need to see if i can just get
between that.
Post by Felix Dorner
It is basically a pita to do. If you read through the initial bug in my
first reply you will find an explanation for how the eclipse releng team
solves this for the beta Java x patches.
Post by Johan Compagner
I have tried a few more things but with no luck
So the question remains what really needs to be configured.
Many things i find are all about a p2 build not tycho
So i have a plugin of eclipse "org.eclipse.help.ui" that i want to patch
(use my version)
that plugin is as far as i know a member of the feature "org.eclipse.help"
so i have my own " org.eclipse.help.ui" plugin project in my workspace
(besides all other plugins)
with the exact same version (i tried also others) as the plugin that i
want to override.
i make a patch feature project that requires that help feature.
add that plugin to that feature
But what to do then?
Should i include that patch feature in my main feature.xml?
Should i add stuff the the pom.xml of the product build?
i first create all the plugins and store them in my local repo
Then i make the 2 feature modules (my own and the patch feature) and
then i execute the product build
But the repository that is then assembled always have the eclipse plugin
not my plugin...
So what step do i miss here? How can i make sure that the plugin is
completely overwritten by mine?
i guess i need to have the same version right? else i break the eclipse
help feature.
johan
Post by Johan Compagner
i am not the only one with questions
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389698#c11
i never used the feature patch feature...
Previously i just had a target folder (which was an eclipse version)
where i just copied over the patched jars. and eclipse p2 then created a
product from that install
http://wiki.eclipse.org/JDT_UI/Howto/Create_Feature_Patch
<feature
id="org.eclipse.help.patch"
label="Help Patch"
version="1.0.0">
<requires>
<import feature="org.eclipse.help" version="2.2.103.v20180301-0715"
patch="true"/>
</requires>
<plugin
id="org.eclipse.help.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
but what should i now do with that feature? i can't include it into my
core product feature because it then complains
Or should he version of my custom org.eclipse.help.ui be exactly the
same as the one i want to patch (inside the org.eclipse.help feature)
Post by Felix Dorner
If I understand you, you want to replace a plugin in eclipse with a
custom built one, to fix a bug. You need a feature patch for this. Once you
know what that is, you can go and find out how to build one with tycho. You
said you did this before but without tycho, what build system did you use
before?
so it is that featureToPatch entry i guess
But what to do in tycho for that is not really clear to me if i look at
https://github.com/eclipse/eclipse.platform.releng.
aggregator/blob/master/eclipse-platform-parent/pom.xml#L617
What should i create locally? I now just have the plugin
Should i also create the exact same feature?
Post by Felix Dorner
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse
installation i could just patch some eclipse jars to get some bugs out from
then and build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension
point but there can be only one of them
* Note that the standard implementation of the help system UI is
provided by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the
platform can only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to
extend this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to provide
a better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly different
version.
Because then the whole eclipse.help.feature doesn't work (if my
feature would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin
always from there?
(or that my local plugins are alway overwriting the once that come
from p2 repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait
for an 4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use
that patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
Johan Compagner
2018-04-19 15:02:12 UTC
Permalink
so after a lot of trial and error i just hacked my way around it in a much
easier way then any of the things i can find on the web.

I now just cloned the plugin i wanted to patch (and copied it into my own
git repo)
did my changes to the code i wanted, set the version to exactly what is
shipped (so filled in the .qualifier part)

then adjust the pom.xml: (i moved the plugin to our group id)

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>adjust the p2 osgi area to overwrite the eclipse plugin</id>
<phase>install</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.servoy</groupId>
<artifactId>org.eclipse.help.ui</artifactId>
<version>${project.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${settings.localRepository}/p2/osgi/bundle/org.eclipse.help.ui/${project.version}/</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>com.servoy</groupId>
<artifactId>org.eclipse.help.ui</artifactId>
<version>${project.version}</version>
<type>xml</type>
<classifier>p2artifacts</classifier>
<overWrite>true</overWrite>
<outputDirectory>${settings.localRepository}/p2/osgi/bundle/org.eclipse.help.ui/${project.version}/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>

so now when that plugin build it just replaces the 2 files that tycho/p2
places in the maven repo completely.
Then after that when i make the product it will pick up this file.

This is by far the easiest that i could find, i still think tycho should do
this for me by some simple configuration for example:

<artifactId>target-platform-configuration</artifactId>

should have another thing besides <environments> and <filters>

<patches>
<patch>
<groupId>org.eclipse.help</groupId> <!! maybe not needed? because
there is not really a group in the p2 repo? >
<artifactId>org.eclipse.help.ui</artifactId>
<version>4.1.0.v20170311-0931</version>
<patchGroupId>com.servoy</patchGroupId> <!! maybe also not needed,
then it really is under the same group, but really in the local repo? >
</patch>
</patches>

Then tycho will just replace that normal plugin jar with the one that is
targeted with the patchGroupId (and the artifactid that should i guess be
just the same) and the version.
And if suddenly the to patch plugin is not there or the patched jar/plugin
itself (for both that specific version) it should fail the build...
Because then it mean that the target p2 repo is updated and that specific
plugin version is not there anymore and i need to check it.

i will make a feature request in bugzilla to see what others think.
Post by Johan Compagner
problem with that is that almost all the urls in that second comment for
example are not working anymore
So there is not really an example, except that one that shows the parent.pom
I don't get why this is so hard to do..
The solution can be so simple, just let tycho for all the plugins that he
gathers to assemble the repository look first into the local repo's if it
is there, instead of getting it from the outside p2 repo.
So when i want to override 1 plugin i just clone that plugin in my local
workspace with that specific version, and build it locally and push it in
my local repo
then a product bulid just picks that one up..
We could even say if that scanning always first is taking to much time or
is harder to do that we can specify this in the tycho configuration that
this plugin should come from local repo (just like you can filter plugins)
I wonder if there is a simple live setup of git repo that has such a
patch with tycho.
I just can't find any good examples or just good documentation how to do
this
I am now going another way and trying to patch the assembled repository
just before it materializes the product, will need to see if i can just get
between that.
Post by Felix Dorner
It is basically a pita to do. If you read through the initial bug in my
first reply you will find an explanation for how the eclipse releng team
solves this for the beta Java x patches.
Post by Johan Compagner
I have tried a few more things but with no luck
So the question remains what really needs to be configured.
Many things i find are all about a p2 build not tycho
So i have a plugin of eclipse "org.eclipse.help.ui" that i want to patch
(use my version)
that plugin is as far as i know a member of the feature
"org.eclipse.help"
so i have my own " org.eclipse.help.ui" plugin project in my workspace
(besides all other plugins)
with the exact same version (i tried also others) as the plugin that i
want to override.
i make a patch feature project that requires that help feature.
add that plugin to that feature
But what to do then?
Should i include that patch feature in my main feature.xml?
Should i add stuff the the pom.xml of the product build?
i first create all the plugins and store them in my local repo
Then i make the 2 feature modules (my own and the patch feature) and
then i execute the product build
But the repository that is then assembled always have the eclipse plugin
not my plugin...
So what step do i miss here? How can i make sure that the plugin is
completely overwritten by mine?
i guess i need to have the same version right? else i break the eclipse
help feature.
johan
Post by Johan Compagner
i am not the only one with questions
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389698#c11
i never used the feature patch feature...
Previously i just had a target folder (which was an eclipse version)
where i just copied over the patched jars. and eclipse p2 then created
a product from that install
http://wiki.eclipse.org/JDT_UI/Howto/Create_Feature_Patch
<feature
id="org.eclipse.help.patch"
label="Help Patch"
version="1.0.0">
<requires>
<import feature="org.eclipse.help" version="2.2.103.v20180301-0715"
patch="true"/>
</requires>
<plugin
id="org.eclipse.help.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
but what should i now do with that feature? i can't include it into my
core product feature because it then complains
Or should he version of my custom org.eclipse.help.ui be exactly the
same as the one i want to patch (inside the org.eclipse.help feature)
Post by Felix Dorner
If I understand you, you want to replace a plugin in eclipse with a
custom built one, to fix a bug. You need a feature patch for this. Once you
know what that is, you can go and find out how to build one with tycho. You
said you did this before but without tycho, what build system did you use
before?
so it is that featureToPatch entry i guess
But what to do in tycho for that is not really clear to me if i look
https://github.com/eclipse/eclipse.platform.releng.aggregato
r/blob/master/eclipse-platform-parent/pom.xml#L617
What should i create locally? I now just have the plugin
Should i also create the exact same feature?
Post by Felix Dorner
You can look at https://bugs.eclipse.org/bugs/show_bug.cgi?id=497840
Post by Johan Compagner
Hi,
previously when we used the "target" dir that has an eclipse
installation i could just patch some eclipse jars to get some bugs out from
then and build a product against that target dir.
How to do that with tycho?
I have now 2 examples, 1 is the "org.eclipse.help.ui" plugin
That just doesn't really work like it should according to me
i patched the source code in a few places and rebuild the plugin
But the problem is how to let tycho know that it has to use that plugin?
that help.ui is a bit special..
because that implements the "org.eclipse.ui.helpSupport" extension
point but there can be only one of them
* Note that the standard implementation of the help system UI is
provided by
* the <code>"org.eclipse.help.ui"</code> plug-in. Since the
platform can only
* make use of a single help system UI implementation, make sure that the
* platform is not configured with more than one plug-in trying to
extend this
* extension point.
yeah right.. how to do that then?
Because i want of course the rest of the help, i only want to
provide a better impl of the HelpUI
Problem is that i can't give that patched plugin a slightly
different version.
Because then the whole eclipse.help.feature doesn't work (if my
feature would include that bumbed version)
Is there somehow a tycho property where i can say get this plugin
always from there?
(or that my local plugins are alway overwriting the once that come
from p2 repositories)?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=509819
i also kind of want to patch that myself, because no i have to wait
for an 4.8 release to have that fixed...
But i encounter then the same problem.. how to force tycho to use
that patched version and not the one from the p2 repo.
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
--
Johan Compagner
Servoy
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
--
Johan Compagner
Servoy
Continue reading on narkive:
Loading...