maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Reed <ran...@opennms.org>
Subject Can't make maven-plugin-testing-harness work...
Date Mon, 04 Jun 2012 14:29:05 GMT
I'm trying to write a maven plugin.  I've added
maven-plugin-testing-harness to my project as a test dependency, and
created a very simple test that right now just tries to load a pom
whose only content is a <plugin> section to load the plugin.

If I have it load like this:

> <plugin> <groupId>org.opennms.maven.plugins</groupId> 
> <artifactId>features-maven-plugin</artifactId> 
> <version>1.0-SNAPSHOT</version> </plugin>

...it bombs with this exception:

org.apache.maven.plugin.testing.ConfigurationException: Cannot find a
configuration element for a plugin with an artifactId of
features-maven-plugin.
	at
org.apache.maven.plugin.testing.AbstractMojoTestCase.extractPluginConfiguration(AbstractMojoTestCase.java:466)

I thought the "configuration" section of a plugin was supposed to be
optional.  However, if I add "<configuration></configuration>" after
the <version> tag above, it gives me a new error:

org.codehaus.plexus.component.repository.exception.ComponentLookupException:
java.util.NoSuchElementException
      role: org.apache.maven.plugin.Mojo
  roleHint:
org.opennms.maven.plugins:features-maven-plugin:1.0-SNAPSHOT:generate-features-xml
	at
org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:257)


...am I doing something wrong?  Seems like the test framework is
breaking on the simplest things, I'm not sure how to start out if I
can't even unit test this.


Code is here:
https://github.com/RangerRick/opennms-maven-plugins/blob/features-maven-plugin/features-maven-plugin

Test is at:
https://github.com/RangerRick/opennms-maven-plugins/blob/features-maven-plugin/features-maven-plugin/src/test/java/org/opennms/maven/plugins/karaf/GenerateFeaturesXmlMojoTest.java

-- 
Benjamin Reed
The OpenNMS Group
http://www.opennms.org/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message