Bug 440157 - Qualifier Handling
Summary: Qualifier Handling
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 454747 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-07-22 16:35 EDT by Remo Meier CLA
Modified: 2021-04-28 16:52 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remo Meier CLA 2014-07-22 16:35:04 EDT
BuildQualifierMojo make use of the following code to separate the qualifier:

  String version = project.getArtifact().getVersion();
        if (version.endsWith("-" + Artifact.SNAPSHOT_VERSION)) {
            version = version.substring(0, version.length() - Artifact.SNAPSHOT_VERSION.length() - 1);
        }

The correct way would be to just use a split at "-" regardless of whether the qualifier is SNAPSHOT or something else like Final. Only supporting the snapshot qualifier makes it impossible to setup a proper versioning mechanism with Betas, Final version and Patches.
Comment 1 Martin Schreiber CLA 2014-08-01 02:04:22 EDT
Patch submitted for review: https://git.eclipse.org/r/#/c/30845/
Comment 2 Igor Fedorenko CLA 2014-08-01 04:57:56 EDT
I am not convinced this is a good idea. -SNAPSHOT has special meaning in Maven, while other suffixes do not. Maven does not expand 1.2.3-Final version, and I don't expect Tycho to expand it either.
Comment 3 Martin Schreiber CLA 2014-08-01 05:05:33 EDT
(In reply to Igor Fedorenko from comment #2)
> I am not convinced this is a good idea. -SNAPSHOT has special meaning in
> Maven, while other suffixes do not. Maven does not expand 1.2.3-Final
> version, and I don't expect Tycho to expand it either.

I see your point, so than that's a feature not a bug - right?
Comment 4 Igor Fedorenko CLA 2014-08-01 05:13:03 EDT
At very least more discussion is warranted, I think, and m2e-dev mailing list is a good place. Personally, I don't like this change. I had bundles versioned as 1.2.3-GA in the past, and that was the exact version I wanted. Most likely the "fix" is to make versioning scheme somehow configurable. I think the default scheme should be left as-is, but there should be API to contribute and enable alternative schemes.
Comment 5 Jan Sievers CLA 2014-08-01 06:32:08 EDT
(In reply to Igor Fedorenko from comment #4)
> Most likely the "fix" is to make versioning scheme somehow configurable. I
> think the default scheme should be left as-is, but there should be API to
> contribute and enable alternative schemes.

+1 

while the current scheme 

maven version x.y.z-SNAPSHOT <-> osgi/p2 version  x.y.z.qualifier

maven version x.y.z <-> osgi version x.y.z

is simple and it's easy for tacho to do a lookup maven artifact <-> osgi artifact both ways, it's probably not flexible enough as there are different versioning schemes used by different projects.

At this point the lookup between maven and osgi/p2 artifacts is implicitly hardcoded and spread over various places int the tycho codebase, so it will take significant work to isolate these so we can make it pluggable.

also see similar bug 382482
Comment 6 Tobias Oberlies CLA 2014-08-18 07:22:56 EDT
(In reply to comment #0)
> Only supporting the snapshot qualifier makes it impossible to setup a proper
> versioning mechanism with Betas, Final version and Patches.

Do you have more details on what you consider a "proper version mechanism". Maven and Eclipse have quite distinct ideas on this - so please make sure to always propose what the Maven and what the OSGi version should be according to you.
Comment 7 Tobias Oberlies CLA 2014-12-15 05:19:56 EST
(In reply to comment #5)
> maven version x.y.z-SNAPSHOT <-> osgi/p2 version  x.y.z.qualifier
> maven version x.y.z <-> osgi version x.y.z
These are the schemes that we currently support.

> also see similar bug 382482
This bug proposes to also allow
maven version x.y.z <-> osgi version x.y.z.qualifier (with "qualifier" being replaced with the build qualifier)

I'm open for other ideas, but so far I haven't seen anything that was properly thought-out yet.
Comment 8 Tobias Oberlies CLA 2014-12-15 05:22:31 EST
*** Bug 454747 has been marked as a duplicate of this bug. ***
Comment 9 Mickael Istria CLA 2021-04-08 18:06:45 EDT
Eclipse Tycho is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse/tycho/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Tycho 2.4.0-SNAPSHOT
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse/tycho/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the Bugzilla component for Tycho will be archived and made read-only.