-
Notifications
You must be signed in to change notification settings - Fork 642
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
invoking lifecycles before direct goals #315
Comments
I think its because of line 34 in SourceJarMojo. Which lifecycle phase do you want to call before the direct commands ? I wonder whether this is always that what is needed or whether calling and whether a goal is called twice when e.g. called with |
i want the the also - while in this discussion, whats' the reason for the javadoc annoations vs vs real annotations? was that to support an older version of the jdk and just a carry over now that the project requires 1.7 to run? |
also, as an aside, i can find no way to do this in maven configuration itself, otherwise i would. |
Yeah, now I remember ;) There is no particular reason now for using comments instead of annotations except to allow older Maven versions. There is still an issue open (don't remember exactly which) where support for older Maven versions is requested. It seems, which should be careful which Maven versions to support, since in enterprise there are often only really ancient Maven installations allowed. So its not so much about Java 7. |
It's #290 which needs 3.0.3. Unfortunately I didn't had time yet to check what exactly we need from new Maven versions ... |
hrm - i guess we'll have to decide where the cut off is for maven version support like we have for docker api versions so the plugin can move forward. i will look into this by the end of day tomorrow and report back my finding and hopefully a PR. also - at some point, i wonder if we will need to start maintaining two lines that support an older version of maven. i can see the argument that it's not fair to exclude users on what may be a fringe edge case. i wonder if older versions of maven would just ignore the annotation if they didn't know what to do w/ it. also - the compiler plugin in the pom sets the source/target version to |
Completely agreed: If it's not to hard and we won't lose opportunities I would stay as backward compatible as possible. E.g. when the usage of annotations over javadoc comments has a substantial functional advantage I would go for it. If it is only a matter of taste and because since such annotations doesn't have to be written very often, I would leave it then. We can always then say: This version of d-m-p is the latest supporting this and this. I definitely do not want to maintain two lines of development and also don't hesitate to go on (with some care). After all, we want to have fun, too :) |
i'll report back my findings soon. |
Since I'm currently working on a 'docker:source' for attaching the docker build tar to the Maven repo, I found out that these class level comments work nicely for calling another phase before calling oneself (even only once in a session)
See also https://maven.apache.org/plugin-tools/maven-plugin-tools-java/index.html |
perfect - so we can change the other mojos to rely on the initialization phase and open up a whole new realm of integration possibilities. it's still unfortunate this can't be done directly through xml configuration though. |
yep. btw next week I'm on vacations and the November will be busy for me. 'happy to integrate PRs, though ;-) |
lol - ok. i'll keep that in mind. the new job has me swamped trying to fix a build that hasn't seen any kind of love in a long time. i'm slowing starting to climb out of that hole, so change is coming. :) enjoy your vacation!! |
About annotations, you can use Java5 annotations to generate the plugin descriptor file since Maven version 3.0. ;) |
See #505 (comment) for a discussion why forking the lifecycle is not so trivial and can cause issues. |
See #448 for a real world issue of this. |
i know this has been a discussion before...did we ever come to any resolution on this, i can't remember.
if we didn't, guess what i just found/realized! the
source:jar
goal invokes thegenerate-sources
lifecycle phase before it execute itself, which is what i want thedocker:*
commands to do. now i can go digging through that code to see how it's done.if we did figure something out,
sheepish grin
for not remembering and having to ask what we came up w/. :)The text was updated successfully, but these errors were encountered: