[ 
https://issues.apache.org/jira/browse/MCOMPILER-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16794998#comment-16794998
 ] 

David M. Lloyd commented on MCOMPILER-320:
------------------------------------------

Still missing is the ability to provide a dependency that only applies to one 
compiler execution and is not a part of the standard dependency set.  This is 
required (for example) when building Java 8 sources using the {{--release}} 
switch, which must nevertheless use APIs that are not part of the base set for 
Java 8 shipped with later JDKs.  Adding the APIs as a regular dependency is 
impossible because any other phase or plugin will fail when using stubbed 
classes.

If a new dependency scope were added - one which *only* applies during 
compilation and is completely invisible to all other phases, and only applies 
to certain plugin executions - then the problem will disappear.  However, this 
seems very unlikely due to complexity, compatibility impacts, and other 
potential problems.

Thus it still makes sense (to me at least) to include 
{{additionalClassPathElements}} (which I will remind you is also a part of 
other standard plugins, just not this one) as a useful "escape hatch" to solve 
problems that cannot be easily solved any other way.

An alternative would be to add a variation which accepts GAV instead of 
filesystem locations.  While less flexible, this would also solve the use cases 
I know about.

> Allow additional class path items to be given during compilation
> ----------------------------------------------------------------
>
>                 Key: MCOMPILER-320
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-320
>             Project: Maven Compiler Plugin
>          Issue Type: New Feature
>            Reporter: David M. Lloyd
>            Priority: Major
>
> At present it is very difficult to include additional class path items during 
> compilation that are not dependencies.  But this is a very useful capability, 
> especially when doing partial builds, MR JARs, JDK API stubbing, including 
> dependency items that cannot be included in any other build phase or 
> execution, etc.
> This enhancement and pull request are to request the addition of a 
> {{additionalCompilePathItems}} property in CompilerMojo or 
> AbstractCompilerMojo which includes additional filesystem paths in the 
> compilation class path.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to