maven-plugin-plugin doesn't package plugin descriptor in jar file

I have this in my pom.xml file as a maven plugin:
   <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-plugin-plugin</artifactId>
                <version>3.9.0</version>
                <configuration>
                    <packagingTypes>
                        <packagingType>jar</packagingType>
                    </packagingTypes>


                </configuration>
                <executions>
                    <execution>
                        <id>default-descriptor</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>descriptor</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

The packaging of my project isn't currently set to
 <packaging>maven-plugin</packaging>

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.
Was this page helpful?