maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J. Lewis Muir" <jlm...@imca-cat.org>
Subject Re: Extension does not work from .mvn/extensions.xml
Date Thu, 15 Nov 2018 23:06:31 GMT
On Wed, Nov 14, 2018 at 3:31 PM Romain Manni-Bucau
<rmannibucau@gmail.com> wrote:
> You can debug using mvnDebug but i think it is cause there is already a
> property handler -
> https://github.com/apache/maven/blob/master/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/PropertyProfileActivator.java
> - so depending the scanning order you take one or the other. Try using
> another marker maybe or making yours higher priority probably.

Hi, Romain!

Thank you for your reply!

What do you mean by "using another marker"?

How can I make mine have higher priority?

I looked at

  http://codehaus-plexus.github.io/plexus-containers/plexus-component-annotations/apidocs/

and the Component annotation has a number of elements, but none of
them look like they would let me assign a priority (e.g., an element
named "priority").  I also don't see an annotation that looks like it
would let me assign a priority (e.g., an annotation named "Priority").

The closest I could find to the concept of a priority was a Stack
Overflow answer

  https://stackoverflow.com/a/41970497

where the author talks about a solution which I think refers to this commit

  https://github.com/Code-House/maven-osgi-resolver/commit/e0b9797657d90eb35a8a166efbf3e01c09fd4189

where he adds a dependency on org.eclipse.sisu:org.eclipse.sisu.inject
and adds a Priority annotation

  http://www.eclipse.org/sisu/docs/api/org.eclipse.sisu.inject/reference/org/eclipse/sisu/Priority.html

However, in the very next commit, the author removes the Priority
annotation believing it to be unnecessary

  https://github.com/Code-House/maven-osgi-resolver/commit/67e3b31d18d1efb0b8f279a1bbacfa39b88d3236

I understand Sisu to be this project

  http://www.eclipse.org/sisu/

but I don't know much else about it.

I'm also a little concerned with what I see in DefaultModelBuilderFactory

  https://github.com/apache/maven/blob/master/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilderFactory.java

in its newProfileActivators method: it creates an instance of
PropertyProfileActivator which would seem to bypass any injection
(including that of my AdvancedProfileActivator).  The class comment
says, though,

  This class is only meant as a utility for developers that want to
  employ the model builder outside of the Maven build system, Maven
  plugins should always acquire model builder instances via dependency
  injection.

So maybe I don't have to worry about it?

Thanks!

Lewis

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message