[ http://jira.codehaus.org/browse/MNG-1251?page=all ]
Jerome Lacoste updated MNG-1251: -------------------------------- Attachment: MNG-1251_more_flexible_attach_artifact.diff This fixes it for me. Not sure if that is the right thing to do, in particular with the API now potentially inconsistent: projectHelper.attachArtifact( project, "zip", null, toFile ); fails while projectHelper.attachArtifact( project, "zip", toFile ); works one may want to look into that. Some comments: - the updates to the poms are probably not needed. I just wanted to be sure to use 2.0.1-SNAPSHOT material. Feel free to apply separately. - AttachedArtifact has a strange way of redirectign method calls to the parent instance. I came up with the fix in 5 minutes and it took me 30 min more to find out that the getArtifactHandler() was 'bypassing' my intended changes... - and no, I don't have a test case... Except that this fixes what I've been trying to do. [INFO] [install:install] [INFO] Installing /home/jerome/Dev/m2/mojo-site/mojo/mojo-sandbox/webstart-maven-plugin/src/test/projects/project1/pom.xml to /home/jerome/.m2/repository-m2trunk/org/apache/maven/plugins/jar-mng-1130-0/1.0/jar-mng-1130-0-1.0.pom [INFO] Installing /home/jerome/Dev/m2/mojo-site/mojo/mojo-sandbox/webstart-maven-plugin/src/test/projects/project1/target/jar-mng-1130-0-1.0.zip to /home/jerome/.m2/repository-m2trunk/org/apache/maven/plugins/jar-mng-1130-0/1.0/jar-mng-1130-0-1.0.zip :) > attachArtifact doesn't allow to attach an artifact with different type and no > assembly > -------------------------------------------------------------------------------------- > > Key: MNG-1251 > URL: http://jira.codehaus.org/browse/MNG-1251 > Project: Maven 2 > Type: Bug > Components: maven-project > Versions: 2.0 > Reporter: Jerome Lacoste > Assignee: John Casey > Priority: Blocker > Fix For: 2.0.1 > Attachments: MNG-1251_more_flexible_attach_artifact.diff > > > Use case: a project triggers a plugin which generates several files. I want > to put all these files in a zip file and install it when calling install. > So I bind my plugin to the package phase, I keep the project packaging as > pom, and then i tri to do soemthing like projectHelper.attachArtifact( > project, "zip", null, toFile ); in my execute() method > this fails in 2 places: > - empty or null classifier is disallowed by AttachedArtifact > - then AttachedArtifact inherits the parent's ArtifactHandler which then will > return "pom" as extension instead of "zip" (the type) . > Thus my artifact ends up being installed in finalName-forcedClassifier.pom > instead of finalName.zip... > Blocks my webstart plugin development, > Note that project.attachArtifact() looks empty... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]