-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@Parameter in Abstract classes in other library are ignored #73
Comments
My reproducer for this issue can be found here: |
I've pushed a reproducer test here: 1130a30 Now I just need to figure out what's going on and fix it :) |
This one is going to be tricky to fix. It looks like I need to pass the mojo project's compile dependencies to the maven mojo scanning infrastructure. Not sure when I will have the time look into this. |
The problem seems to be in how |
I really appreciate your efforts, I had a very quick look at the code and I know this is not a PR I can work on (I do not have the bandwidth to understand what is going on and how to change it) |
@jmini no worries. I'm just writing this down here as a reminder for myself 🙂 I think it's possible to make this work for dependencies that are build from the same project. It's going to be difficult to implement for external dependencies where the mojo base class is coming from an artifact from an internal repository. The reason being that Maven plugin tools make requests to download the sources jar and the whole infrastructure to do that simply can not be bootstrapped in context of my plugin. But I will try to find a way to make it work for project dependencies at least. |
I think I found a fix and pushed that to a84a395. It still needs some polishing and testing but it looks promissing. |
@jmini could you please try if version 0.4.0 fixes the problem for you? Note that extraction only work for project dependencies, but not for exterenal dependencies. So I hope the mojo base class is in one of the modules of the same build. |
Given a
lib
project containingsample.lib.AbstactNameMojo
:And a plugin (using
'de.benediktritter.maven-plugin-development' version '0.3.1'
) containing a Mojo extending the abstract one.The generated metadata do not contains the
name
information.Therefore when the plugin will be used, Maven will only configure
greeting
andname
will always stay null.This can be observed when running maven with
-X
.By inspecting the file
META-INF/maven/plugin.xml
in the generated jar, we see the issue:If the abstract class is in the same project (not in an other lib) it is working as expected, the generated
META-INF/maven/plugin.xml
looks like this:Other file
META-INF/maven/<groupId>/plugin/plugin-help.xml
is wrong as well.The text was updated successfully, but these errors were encountered: