Discussion:
[tycho-user] way to check required-plugin version
LE FEVRE FRANCOIS
2017-08-04 08:44:10 UTC
Permalink
Dear Tycho user,

I would like to know if there is a Tycho or maven plugin that could check the consistency of required-plugin'versions in a project containing several eclipse plugins.

When using pure maven java project, dependencies version are listed in dependency management section.
You can define in one place the version of the java plugin you are using in the whole project, included the children maven modules.

In one of our eclipse project managed by maven/Tycho, we have several eclipse plugins listed as children modules.
In each eclipse plugins we have a MANIFEST.MF with required bundles
For the bundles that are extracted from the children module, sometimes the developer upgrade the version of the module but forgot to upgrade the different modules that list this plugin as required bundle.
How can we check automatically that all versions are the same for a given module?
Is there a way to define outside the version of the required bundles that belongs to the same project?


For instance
Project A
/bundle A1, v 1.0.0
/bundle A2 v 1.0.0 -->depends on A1 v [1.0.0,2.0.0)
/bundle A3 v 1.0.0-->depends on A1 v [1.0.0,2.0.0)

The developer upgrade the version of A1 to 1.1.0 and reflect it in A2 but forgot to do it in A3

Project A
/bundle A1, v 1.1.0
/bundle A2 v 1.0.0 -->depends on A1 v [1.1.0,2.0.0)
/bundle A3 v 1.0.0-->depends on A1 v [1.0.0,2.0.0)

How can we gather the fact that in all plugins in the project A, the A1 version to be used is 1.1.0

Thanks for your help and ideas.

Francois
Sievers, Jan
2017-08-04 10:14:14 UTC
Permalink
not sure if this applies to your problem, but tycho-versions-plugin has an option to adapt referencing version ranges

https://eclipse.org/tycho/sitedocs/tycho-release/tycho-versions-plugin/set-version-mojo.html#updateVersionRangeMatchingBounds

Regards
Jan

On 04.08.17, 10:44, "tycho-user-***@eclipse.org on behalf of LE FEVRE FRANCOIS" <tycho-user-***@eclipse.org on behalf of francois.le-***@cea.fr> wrote:

Dear Tycho user,

I would like to know if there is a Tycho or maven plugin that could check the consistency of required-plugin’versions in a project containing several eclipse plugins.

When using pure maven java project, dependencies version are listed in dependency management section.
You can define in one place the version of the java plugin you are using in the whole project, included the children maven modules.

In one of our eclipse project managed by maven/Tycho, we have several eclipse plugins listed as children modules.
In each eclipse plugins we have a MANIFEST.MF with required bundles
For the bundles that are extracted from the children module, sometimes the developer upgrade the version of the module but forgot to upgrade the different modules that list this plugin as required bundle.
How can we check automatically that all versions are the same for a given module?
Is there a way to define outside the version of the required bundles that belongs to the same project?


For instance
Project A
/bundle A1, v 1.0.0
/bundle A2 v 1.0.0 àdepends on A1 v [1.0.0,2.0.0)
/bundle A3 v 1.0.0àdepends on A1 v [1.0.0,2.0.0)

The developer upgrade the version of A1 to 1.1.0 and reflect it in A2 but forgot to do it in A3

Project A
/bundle A1, v 1.1.0
/bundle A2 v 1.0.0 àdepends on A1 v [1.1.0,2.0.0)
/bundle A3 v 1.0.0àdepends on A1 v [1.0.0,2.0.0)

How can we gather the fact that in all plugins in the project A, the A1 version to be used is 1.1.0

Thanks for your help and ideas.

Francois
LE FEVRE FRANCOIS
2017-08-08 09:04:46 UTC
Permalink
Sorry to come back.
Any idea to solve my problem?

Thanks
Francois

De : tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] De la part de LE FEVRE FRANCOIS
Envoyé : vendredi 4 août 2017 10:44
À : Tycho user list <tycho-***@eclipse.org>
Objet : [PROVENANCE INTERNET] [tycho-user] way to check required-plugin version

Dear Tycho user,

I would like to know if there is a Tycho or maven plugin that could check the consistency of required-plugin'versions in a project containing several eclipse plugins.

When using pure maven java project, dependencies version are listed in dependency management section.
You can define in one place the version of the java plugin you are using in the whole project, included the children maven modules.

In one of our eclipse project managed by maven/Tycho, we have several eclipse plugins listed as children modules.
In each eclipse plugins we have a MANIFEST.MF with required bundles
For the bundles that are extracted from the children module, sometimes the developer upgrade the version of the module but forgot to upgrade the different modules that list this plugin as required bundle.
How can we check automatically that all versions are the same for a given module?
Is there a way to define outside the version of the required bundles that belongs to the same project?


For instance
Project A
/bundle A1, v 1.0.0
/bundle A2 v 1.0.0 -->depends on A1 v [1.0.0,2.0.0)
/bundle A3 v 1.0.0-->depends on A1 v [1.0.0,2.0.0)

The developer upgrade the version of A1 to 1.1.0 and reflect it in A2 but forgot to do it in A3

Project A
/bundle A1, v 1.1.0
/bundle A2 v 1.0.0 -->depends on A1 v [1.1.0,2.0.0)
/bundle A3 v 1.0.0-->depends on A1 v [1.0.0,2.0.0)

How can we gather the fact that in all plugins in the project A, the A1 version to be used is 1.1.0

Thanks for your help and ideas.

Francois
Mickael Istria
2017-08-08 09:16:18 UTC
Permalink
Hi,
Post by LE FEVRE FRANCOIS
For the bundles that are extracted from the children module, sometimes the
developer upgrade the version of the module but forgot to upgrade the
different modules that list this plugin as required bundle.
[...]
The developer upgrade the version of A1 to 1.1.0 and reflect it in A2 but
forgot to do it in A3
First, this is actually a good OSGi practice to *not* update versions
unless needed (ie if resulting binary did chnage). Not changing version
allows to have a broad compatibility range, which can be pretty convenient.
PDE API Tools can help (in the IDE) to remind to update versions according
to OSGi best practices, at Tycho level, there isn't an easy way to enable
PDE API Tools.
However, if you're concerned about compatibility, you can use a combination
of reproducible version quilifiers (
https://wiki.eclipse.org/Tycho/Reproducible_Version_Qualifiers#What_does_this_actually_do.3F
) and of
https://www.eclipse.org/tycho/sitedocs-extras/tycho-p2-extras-plugin/compare-version-with-baselines-mojo.html
. That would mostly make your build fail is the content of the resulting
jar actually changed (ie if there were code change mostly). Then, from this
failure, the developer gets reminded to update the version.
Post by LE FEVRE FRANCOIS
How can we check automatically that all versions are the same for a given module?
[...]
How can we gather the fact that in all plugins in the project A, the A1
version to be used is 1.1.0
There might be existing mojos or you can write your own one that looks at
all modules in the reactor and fail if they are not equals.
But as far as I know, it's not a common practice.
Post by LE FEVRE FRANCOIS
Is there a way to define outside the version of the required bundles that
belongs to the same project?
No.
--
Mickael Istria
Eclipse IDE <https://www.eclipse.org/downloads/eclipse-packages/>
developer, at Red Hat Developers <https://developers.redhat.com/> community
LE FEVRE FRANCOIS
2017-08-08 13:14:03 UTC
Permalink
Mickael,
Thanks a lot for the time to taken to explain me those elements.
I will try at least to setup the Tycho compare version for the papyrus project, https://git.eclipse.org/r/#/c/98880/
I will explore the links you provided.

Have a good day.

Francois

De : tycho-user-***@eclipse.org [mailto:tycho-user-***@eclipse.org] De la part de Mickael Istria
Envoyé : mardi 8 août 2017 11:16
À : Tycho user list <tycho-***@eclipse.org>
Objet : Re: [tycho-user] way to check required-plugin version


Hi,

On Fri, Aug 4, 2017 at 10:44 AM, LE FEVRE FRANCOIS <francois.le-***@cea.fr<mailto:francois.le-***@cea.fr>> wrote:
For the bundles that are extracted from the children module, sometimes the developer upgrade the version of the module but forgot to upgrade the different modules that list this plugin as required bundle.
[...]
The developer upgrade the version of A1 to 1.1.0 and reflect it in A2 but forgot to do it in A3

First, this is actually a good OSGi practice to *not* update versions unless needed (ie if resulting binary did chnage). Not changing version allows to have a broad compatibility range, which can be pretty convenient. PDE API Tools can help (in the IDE) to remind to update versions according to OSGi best practices, at Tycho level, there isn't an easy way to enable PDE API Tools.
However, if you're concerned about compatibility, you can use a combination of reproducible version quilifiers ( https://wiki.eclipse.org/Tycho/Reproducible_Version_Qualifiers#What_does_this_actually_do.3F ) and of https://www.eclipse.org/tycho/sitedocs-extras/tycho-p2-extras-plugin/compare-version-with-baselines-mojo.html . That would mostly make your build fail is the content of the resulting jar actually changed (ie if there were code change mostly). Then, from this failure, the developer gets reminded to update the version.

How can we check automatically that all versions are the same for a given module?
[...]
How can we gather the fact that in all plugins in the project A, the A1 version to be used is 1.1.0

There might be existing mojos or you can write your own one that looks at all modules in the reactor and fail if they are not equals.
But as far as I know, it's not a common practice.

Is there a way to define outside the version of the required bundles that belongs to the same project?

No.
--
Mickael Istria
Eclipse IDE<https://www.eclipse.org/downloads/eclipse-packages/> developer, at Red Hat Developers<https://developers.redhat.com/> community
Andreas Sewe
2017-08-08 13:52:07 UTC
Permalink
Hi,
Post by LE FEVRE FRANCOIS
I would like to know if there is a Tycho or maven plugin that could
check the consistency of required-plugin’versions in a project
containing several eclipse plugins.
When using pure maven java project, dependencies version are listed in
dependency management section.
In pure Maven, I would use the maven-enforcer-plugin (in particular,
it's dependencyConvergence rule) to ensure that the
<dependencyManagment> defaults are not accidentally overwritten.

I think you can also use this rule (or reactorModuleConvergence) to
achieve what you are after with Tycho. Not 100% sure, but this may be
worth a look.

Hope that helps.

Andreas
--
Codetrails GmbH
The best code possible

Robert-Bosch-Str. 7, 64293 Darmstadt
Phone: +49-6151-276-7092
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940
Loading...