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

Christoph Läubrich commented on MNG-7426:
-----------------------------------------

Also it would require another ticket I think this would probably add to the 
discussion here:

Something similar would be useful in general for dependencies as well! SWT has 
artifacts that contain native code for a given platform.

This currently requires a lot of "profile" magic and is a real mess:

https://github.com/jzy3d/jzy3d-api/blob/f1c2dc433a3bb03575299a118537da8d65acece5/jzy3d-native-jogl-swt/pom.xml#L49-L115

Whyt I have in mind (and what would be similar to this one) that a dependency 
could have an 

{code:java}

<activation>
  <os>
   <family>mac</family>
   <arch>aarch64</arch>
   </os>
</activation>
{code}

and then this dependency is only considered when the activation matches.


> Allow condition (like <activation>) on mojo executions
> ------------------------------------------------------
>
>                 Key: MNG-7426
>                 URL: https://issues.apache.org/jira/browse/MNG-7426
>             Project: Maven
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Mickael Istria
>            Priority: Major
>
> There are some goals that are only expected to run under some circumstances 
> (eg a file exists, we're running on a particular OS...). The current solution 
> to implement that is to create profiles and profiles are great particularly 
> when multiple invocations or other configurations are involved as they allow 
> to group things into a meaningful block; however in many cases, one can want 
> to just decide to enable/disable 1 particular mojo execution. For those cases 
> where only 1 execution is conditional, profiles seem like a lot of 
> boilerplate and complexity.
> Instead, we could imagine to add to `<execution>` element some `<activation>` 
> (or whatever other meaningful name) child that would allow similar 
> evaluations as what's possible with profile execution. When the activation 
> condition is set and returns false, then the execution would be simply 
> skipped.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to