Marmalade

Exception when Marmalade is run as part of M2 plugin install

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Blocker Blocker
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: marmalade-core
  • Labels:
    None
  • Environment:
    - Maven 2 compiled and installed from revision 179977
  • Number of attachments :
    1

Description

When "m2 install" is invoked on the "Hello" Plugin example from Maven 2 website, an Exception as follows is thrown:

[Attachment: Marmalade plugin script]

-----------------------------------------------

java.lang.NullPointerException
at org.codehaus.marmalade.metamodel.AbstractMarmaladeTagLibrary.createTag(AbstractMarmaladeTagLibrary.java:59)
at org.codehaus.marmalade.metamodel.MarmaladeTagBuilder.build(MarmaladeTagBuilder.java:67)
at org.codehaus.marmalade.metamodel.MarmaladeTagBuilder.build(MarmaladeTagBuilder.java:83)
at org.codehaus.marmalade.metamodel.MarmaladeTagBuilder.build(MarmaladeTagBuilder.java:83)
at org.codehaus.marmalade.metamodel.ScriptBuilder.build(ScriptBuilder.java:51)
at org.codehaus.marmalade.launch.MarmaladeLauncher.buildScript(MarmaladeLauncher.java:264)
at org.codehaus.marmalade.launch.MarmaladeLauncher.getMarmaladeScript(MarmaladeLauncher.java:313)
at org.apache.maven.tools.plugin.extractor.marmalade.MarmaladeMojoDescriptorExtractor.extractMojoDescriptors(Marma
ladeMojoDescriptorExtractor.java:89)
at org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor.execute(AbstractScriptedMojoDes
criptorExtractor.java:30)
at org.apache.maven.tools.plugin.scanner.DefaultMojoScanner.populatePluginDescriptor(DefaultMojoScanner.java:69)
at org.apache.maven.plugin.plugin.AbstractGeneratorMojo.execute(AbstractGeneratorMojo.java:93)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:415)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.processGoals(DefaultLifecycleExecutor.java:170)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:91)
at org.apache.maven.DefaultMaven.processProject(DefaultMaven.java:248)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:303)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:243)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:416)
at org.codehaus.classworlds.Launcher.main(Launcher.java:363)

Activity

Hide
Tanju Erinmez added a comment -

Hi there,

the mentioned problem is caused by the <id> tag. If removed, the plugin can be installed successfully.

There are a couple of other problems with the hello world plugin. I have gathered some hints from users@maven.apache.org and posting them below for the sake of completeness.

HTH,
Tanju

You need to do the following:

  • have at least one parameter in your mojo (see the suggestion Hello World example)
  • add the following to your plugin's pom:
    <dependencies>
    <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-plugin-api</artifactId>
    <version>2.0-alpha-3</version>
    </dependency>
    <dependency>
    <groupId>marmalade</groupId>
    <artifactId>marmalade-core</artifactId>
    <version>1.0-alpha-4</version>
    </dependency>
    <dependency>
    <groupId>marmalade</groupId>
    <artifactId>marmalade-el-commons</artifactId>
    <version>1.0-alpha-3</version>
    </dependency>
    <dependency>
    <groupId>marmalade</groupId>
    <artifactId>marmalade-tags-io</artifactId>
    <version>1.0-alpha-3</version>
    </dependency>
    <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-script-marmalade</artifactId>
    <version>2.0-alpha-3</version>
    </dependency>
    </dependencies>
  • create a sample application and add your plugin to the applications' pom as follows:
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-hello-plugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    </plugin>
Show
Tanju Erinmez added a comment - Hi there, the mentioned problem is caused by the <id> tag. If removed, the plugin can be installed successfully. There are a couple of other problems with the hello world plugin. I have gathered some hints from users@maven.apache.org and posting them below for the sake of completeness. HTH, Tanju You need to do the following:
  • have at least one parameter in your mojo (see the suggestion Hello World example)
  • add the following to your plugin's pom: <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>2.0-alpha-3</version> </dependency> <dependency> <groupId>marmalade</groupId> <artifactId>marmalade-core</artifactId> <version>1.0-alpha-4</version> </dependency> <dependency> <groupId>marmalade</groupId> <artifactId>marmalade-el-commons</artifactId> <version>1.0-alpha-3</version> </dependency> <dependency> <groupId>marmalade</groupId> <artifactId>marmalade-tags-io</artifactId> <version>1.0-alpha-3</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-script-marmalade</artifactId> <version>2.0-alpha-3</version> </dependency> </dependencies>
  • create a sample application and add your plugin to the applications' pom as follows: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-hello-plugin</artifactId> <version>1.0-SNAPSHOT</version> </plugin>

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated: