Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why is my maven plugin descriptor not being generated automatically?

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?

like image 347
ken Avatar asked Aug 25 '11 08:08

ken


2 Answers

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>
like image 195
leat Avatar answered Oct 13 '22 01:10

leat


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.

like image 45
Mrugen Deshmukh Avatar answered Oct 12 '22 23:10

Mrugen Deshmukh