Gruust created MNG-7154:
---------------------------

             Summary: "Inline" build helper classes, "build AOP"
                 Key: MNG-7154
                 URL: https://issues.apache.org/jira/browse/MNG-7154
             Project: Maven
          Issue Type: Wish
          Components: Design, Patterns & Best Practices
    Affects Versions: 3.8.1
            Reporter: Gruust


Where maven has shortcomings, I tend to introduce a separate compile phase and 
use the "pre-compiled" class via the exec plugin to extend the build process. 
That's waaaay easier than maintaining a separate plugin, though, of course, 
very limited regarding maven internals. It would be great to have a 
standardized way to do this and have additional capabilities like access to the 
build data and build listeners via annotations.

One possibility would be to introduce a reserved package space, ie. "build.**" 
that would not be included in the final package by default. Instead it would be 
annotation-scanned and treated somewhat like a webapp container, but adjusted 
to the maven build context.

Methods in those classes could be annotated with something like 
@BuildExecutionListener and then decide on their own to execute code before or 
after plugin executions. A @BuildConfig annotation could provide access to 
maven build data. A @Repository annotation could provide access to .m2 
contents. Essentially something close to a build-oriented AOP solution.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to