Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351908 - Tycho artifact handlers should use classifier value null rather than ""
Summary: Tycho artifact handlers should use classifier value null rather than ""
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Igor Fedorenko CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-12 20:50 EDT by Rafal Krzewski CLA
Modified: 2021-04-28 16:55 EDT (History)
1 user (show)

See Also:


Attachments
patch that corrects classifiers for Tycho projects (2.06 KB, patch)
2011-07-12 20:53 EDT, Rafal Krzewski CLA
no flags Details | Diff
patch redone with git format-patch (2.52 KB, patch)
2011-07-13 05:20 EDT, Rafal Krzewski CLA
igor: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafal Krzewski CLA 2011-07-12 20:50:36 EDT
Build Identifier: 

Artifact handler definitions for Tycho packaging types declared in https://github.com/sonatype/sonatype-tycho/blob/master/tycho-maven-plugin/src/main/resources/META-INF/plexus/components.xml contain stanzas like
      <configuration>
        <classifier></classifier>
        <extension>jar</extension>
        <type>eclipse-plugin</type>
        <packaging>eclipse-plugin</packaging>
        <language>java</language>
        <addedToClasspath>true</addedToClasspath>
        <includesDependencies>false</includesDependencies>
      </configuration>

This results in artifact classifier being set to empty String. While in most places this is interpreted as no classifier, there is at least one where code gets confused, namely maven-sources-plugin

[INFO] --- maven-source-plugin:2.1.2:jar-no-fork (attach-sources) @ plugin ---
[WARNING] NOT adding sources to artifacts with classifier as Maven only supports one classifier per artifact. Current artifact [org.eclipe.tycho.it.eclipse-repository-release:plugin:eclipse-plugin:1.0.0] has a [] classifier.

I've checked the convention used by maven core: http://svn.apache.org/viewvc/maven/maven-3/tags/maven-3.0/maven-core/src/main/resources/META-INF/plexus/artifact-handlers.xml?view=markup 
and the artifact handlers that don't use the classifier, omit <classifier> tag completely.

I've applied the same convention to tycho-maven-plugin/.../components.xml and observed that maven-sources-plugin started to behave correctly.

Reproducible: Always

Steps to Reproduce:
1. run mvn org.apache.maven.plugins:maven-source-plugin:2.1.2:jar-no-fork on any Tycho project
2. sources are not packaged
Comment 1 Rafal Krzewski CLA 2011-07-12 20:53:14 EDT
Created attachment 199538 [details]
patch that corrects classifiers for Tycho projects

A trivial patch that fixes this issue
Comment 2 Igor Fedorenko CLA 2011-07-13 02:23:38 EDT
For proper attribution purposes, can you re-attach your patch as git-format-patch?
Comment 3 Rafal Krzewski CLA 2011-07-13 05:20:37 EDT
Created attachment 199551 [details]
patch redone with git format-patch

Sorry, I'm new to git, I didn't know about that feature :) Let me know if it's OK now.
Comment 4 Igor Fedorenko CLA 2011-07-14 04:28:20 EDT
Applied the patch. Thank you.