Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351908

Summary: Tycho artifact handlers should use classifier value null rather than ""
Product: z_Archived Reporter: Rafal Krzewski <rafal>
Component: TychoAssignee: Igor Fedorenko <igor>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
patch that corrects classifiers for Tycho projects
none
patch redone with git format-patch igor: iplog+

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.