maven-plugin-plugin doesn't package plugin descriptor in jar file
I have this in my pom.xml file as a maven plugin:
The packaging of my project isn't currently set to
but even If I try to set it to that the plugin.xml still doesn't get packaged in the jar file. To be clear plugin.xml gets generated under classes/META-INF/maven , but when I open the generated .jar file and go to META-INF/maven the plugin.xml file isn't there. And so when I try to include this project as a plugin it fails with plugin descriptor not found.
31 Replies
⌛
This post has been reserved for your question.
Hey @nikcho-kouhai! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
What is your goal?
well for the most part I want to make a maven plugin
I mean your maven goal?
install or package or clean or whatever?
I tried with mvn package
and with mvn clean install
Ok install is good.
and with mvn install so none of those worked
Where exactly is your plugin.xml stored in src/main/resources/META-INF/maven?
it's generated by maven-plugin-plugin in target/classes/META-INF/maven/plugin.xml
Hm, generated, hm?
do I need to have a plugin.xml in my resources?
No
yeah that's why I included this maven-plugin-plugin thing which supposedly makes plugin descriptors. And it does make the plugin descriptor, it just doesn't package it in my jar
I think the order of the mojos are wrong. I think the jar is packed before the plugin.xml is written.
that could certainly be a reason
Try
mvn clean compile plugin:addPluginArtifactMetadata package install
Funny thing is: plugin:addPluginArtifactMetadata should be callend during package automatically.well it probably does get called, because it didn't work
I literally saw this exact same thing done in another project
I compiled that other project the same way I do mine and it gets its plugins.xml packaged inside the jar
Did my suggestion work?
nope
Ah dammit.
oh also my project has a parent pom, could that be a potential cause?
Can you share what reactor does? Can you share the output of
mvn validate
?
Parent pom could change the build process.
well I also wrote the parent pom and from what I remember I don't think it does such a thing
...probably
My only suggestion now is to put the plugin.xml to
src/main/resources/META-INF/maven
I suppose I'll give it a shot
nope
yet again nowhere to be found in the jar file
which is at this point starting to get from pretty odd to downright what the hell since aren't resources in particular supposed to be bundled in the jar file?
Weird
yeah, that's what I've been saying to myself silently over and over for the past 4 hours
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.
okay so the problem was with an execution of the maven-jar-plugin
I am not entirely sure why/how/what but I deleted it and made maven run the default-cli execution and it works so thanks
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@359755548973072397>.