14

I have wrote my own plugin project and have run the command mvn -install through cygwin for my plugin project. the jar file for it is being created in my repository, however when I execute my plugin, it says that my plugin descriptor is not present. I checked my jar file which was created and indeed it is not automatically created inside there.

I tried copying a sample plugin.xml and included it into my jar file and it worked. I would like to know if anyone knows why my plugin descriptor isn't created automatically?

tshepang
  • 12,111
  • 21
  • 91
  • 136
ken
  • 193
  • 1
  • 3
  • 8

4 Answers4

18

I always miss this but the packaging type is by default "jar" when you create the project in netbeans (and other ides), you have to remember to change it in your pom.xml to:

  <packaging>maven-plugin</packaging>

it is by default:

  <packaging>jar</packaging>
leat
  • 1,418
  • 1
  • 15
  • 21
5

I faced similar issue where in I had configured generation of plugin description file inside "target/dir" folder.I resolved the issue by removing any explicit configuration elements for the maven-plugin-plugin declaration from my pom.xml .

Then calling "mvn package" generated the plugin.xml automatically during maven "packaging" phase.

Now if you call "mvn install" then you can observe that the plugin jar installed in your local maven repository would contain a "plugin.xml" under META-INF/maven folder.

Mrugen Deshmukh
  • 249
  • 2
  • 8
  • 18
1

I got the error when I ran mvn compile. When I ran mvn test, the error went away.

herrtim
  • 2,697
  • 1
  • 26
  • 36
1

Check if you have configured the maven-plugin-plugin with the goal plugin:descriptor in your build section? If not, then manually executing the goal plugin:descriptor before install should also help.

dunni
  • 43,386
  • 10
  • 104
  • 99
  • hi dunni, I have tried plugin:descriptor and I still dont see the plugin.xml being created in my META-INF/maven folder. – ken Aug 26 '11 at 01:58
  • Can you post the output of the mvn call? And try also executing Maven with the parameter -e or -X for debug messages (post the log at pastebin or similar services). – dunni Aug 26 '11 at 06:15
  • 9
    thanks man, i figured it out already i left out maven-plugin in the pom file hope this helps others – ken Aug 26 '11 at 08:51