I had this problem (It's a bug and also a problem in the conception of the core) and I solved it like this :
package com.octo.mtg.plugin; import java.io.File; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProject; /** * Creates a WAR archive and register it in maven. * * @author <a href="mailto:[EMAIL PROTECTED]">Arnaud HERITIER</a> * @version $Id$ * * @description Creates a WAR archive and register it in maven. * @goal maven-war * @phase package * @since 0.1 */ public class MavenWarMojo extends AbstractGrailsMojo { /** * The maven project. * * @parameter expression="${project}" * @required * @readonly */ private MavenProject project; /** * The artifact handler. * * @parameter expression="${component.org.apache.maven.artifact.handler.ArtifactHandler#grails-app}" * @required * @readonly */ protected ArtifactHandler artifactHandler; /** * Executes the MavenWarMojo on the current project. * * @throws MojoExecutionException * if an error occured while building the webapp */ public void execute() throws MojoExecutionException, MojoFailureException { // launch grails launchGrails("war"); File warGeneratedByGrails = new File(getBasedir(), getGrailsDescriptor().getAppName() + "-" + getGrailsDescriptor().getAppVersion() + ".war"); project.getArtifact().setFile(warGeneratedByGrails); project.getArtifact().setArtifactHandler(artifactHandler); } } You have to manually set the file and the artifact handler Arnaud http://forge.octo.com/svn/mtg/trunk/grails-maven-plugin/src/main/java/com/octo/mtg/plugin/MavenWarMojo.java On 01/10/2007, nicolas de loof <[EMAIL PROTECTED]> wrote: > > I just understood I have to configure the plugin in the build/plugins > element with <extensions>true</extensions> > > What's the meaning of the build/extensions element ? > > 2007/10/1, nicolas de loof <[EMAIL PROTECTED]>: > > Hello, > > > > I'd like to add support in maven for a custom packaging. > > I've created a META-INF/plexus/components.xml to define a new > ArtifactHandler : > > > > <component> > > <role>org.apache.maven.artifact.handler.ArtifactHandler</role> > > <role-hint>javascript</role-hint> > > <implementation> > org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> > > <configuration> > > <type>javascript</type> > > <extension>jsar</extension> > > <language>javascript</language> > > <addedToClasspath>false</addedToClasspath> > > </configuration> > > </component> > > > > I the run "mvn install" from a test project that has a dependency of > > type "javascript" and defines my custom plugin as a build extension. > > The requested URL in my repo uses the unexpected ".javascript" > > extension. > > > > Runing maven in a debug session, in DefaultWagonManager.getArtifact() > > the requested artifact doens't have my custom handler attached, but > > what seems to be the default one for unresolved types. > > > > Is this the good way to extend maven ? What's wrong ? > > > > Nico. > > > -- .......................................................... Arnaud HERITIER .......................................................... OCTO Technology - aheritier AT octo DOT com www.octo.com | blog.octo.com .......................................................... ASF - aheritier AT apache DOT org www.apache.org | maven.apache.org ...........................................................
