properties analyze

2018-11-20 Thread Royce Gerard Remer
I'm considering writing a feature for the maven-help-plugin, but wanted to
confer here first: a properties-analyze goal which can:
a) list unused maven properties (like maven-dependency-plugin:analyze)
b) list undeclared properties (this can happen when you have a profile
which references a property which doesn't exist)
c) optionally fail the build for either of the above conditions

I didn't see this in any other maven plugins, and can't find a discussion
on this topic in the lists. I do see a ton of 'cleanup unused properties'
jira issues, however.

Good idea? Already implemented somewhere else? Good idea but wrong place to
implement the feature?


Re: Second MNG-6261

2018-11-20 Thread Enrico Olivelli
Il mar 20 nov 2018, 18:27 Robert Scholte  ha scritto:

> Looking for someone to second this fix.
>
> thanks,
> Robert
>
> Relative parent POM resolution failing in 3.5.0 with complex multimodule
> builds
> https://issues.apache.org/jira/browse/MNG-6261
>
> https://github.com/apache/maven/pull/192/files


I put some comment on github

Enrico


>
> https://builds.apache.org/job/maven-box/job/maven/job/MNG-6261/
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
> --


-- Enrico Olivelli


Re: Extension does not work from .mvn/extensions.xml

2018-11-20 Thread Romain Manni-Bucau
Le mar. 20 nov. 2018 22:24, J. Lewis Muir  a écrit :

> On Tue, Nov 20, 2018 at 1:01 PM Romain Manni-Bucau
>  wrote:
> > Le mar. 20 nov. 2018 19:23, J. Lewis Muir  a écrit
> :
> > > There's no way I can get the developers of the
> > > software I'm planning to use this in to install the extension in
> > > Maven's lib/ext; it has to be able to work from the project's
> > > .mvn/extensions.xml.
> >
> > Even with mvnsh, maven opts or the -D?
>
> Well, it's for a project where I'm not a core developer, so I don't
> think there will be much support for anything that requires doing
> something extra.
>
> I doubt mvnsh would fly.
>

Hmm mvnwrapper works cause it downloads mvn and can use itself to use
dependency:copy to download lissing and add them in the -D if needed IMHO.


> MAVEN_OPTS would work, but it's external and not with the project
> source code, so it requires each developer to do some special setting
> up.  I doubt it would fly.
>
> The closest I can get would be -D in the project's .mvn/maven.config.
> This would require adding the two JARs
> (profile-activation-advanced-0.2.0.jar and mvel2-2.4.2.Final.jar) to
> the project's source code repo, though.  That right there is already
> undesirable.  And then, say the JARs were added under the project's
> root at lib-ext, the following would need to be added to the project's
> .mvn/maven.config:
>
>
> -Dmaven.ext.class.path=lib-ext/profile-activation-advanced-0.2.0.jar:lib-ext/mvel2-2.4.2.Final.jar
>
> That's the closest I could get, and it requires the paths in the
> maven.ext.class.path system property to be resolved relative to the
> project root (so that the relative paths to the JAR files will be
> correct), and I don't even know if that's guaranteed.
>
> So, it's a pretty tough sell at this point.
>
> > > I tried adding the Priority annotation, and it works from Maven's
> > > lib/ext, but it also works *without* it, so I'm hesitant to add it
> > > unless I know it's really necessary.  The readme file in Maven's
> > > lib/ext says
> >
> > Without it you dont deactivate default one - you can check it debugging
> it.
>
> Hmm, how can I check it by debugging?  I tried without the Priority
> annotation with a breakpoint in AdvancedProfileActivator.isActive, and
> I looked at the caller DefaultProfileSelector.isActive frame, which is
> one frame down in the stack, and I see the AdvancedProfileActivator in
> the DefaultProfileSelector's activators list, and I don't see the
> default PropertyProfileActivator.  Attached is a screenshot.  Maybe
> I'm looking in the wrong place?
>

Hmm i had both. I used mvn 3.6.0 during my debugging - shouldnt change
since a few version but we never know.


> Thanks!
>
> Lewis
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org


Re: Extension does not work from .mvn/extensions.xml

2018-11-20 Thread J. Lewis Muir
On Tue, Nov 20, 2018 at 1:01 PM Romain Manni-Bucau
 wrote:
> Le mar. 20 nov. 2018 19:23, J. Lewis Muir  a écrit :
> > There's no way I can get the developers of the
> > software I'm planning to use this in to install the extension in
> > Maven's lib/ext; it has to be able to work from the project's
> > .mvn/extensions.xml.
>
> Even with mvnsh, maven opts or the -D?

Well, it's for a project where I'm not a core developer, so I don't
think there will be much support for anything that requires doing
something extra.

I doubt mvnsh would fly.

MAVEN_OPTS would work, but it's external and not with the project
source code, so it requires each developer to do some special setting
up.  I doubt it would fly.

The closest I can get would be -D in the project's .mvn/maven.config.
This would require adding the two JARs
(profile-activation-advanced-0.2.0.jar and mvel2-2.4.2.Final.jar) to
the project's source code repo, though.  That right there is already
undesirable.  And then, say the JARs were added under the project's
root at lib-ext, the following would need to be added to the project's
.mvn/maven.config:

  
-Dmaven.ext.class.path=lib-ext/profile-activation-advanced-0.2.0.jar:lib-ext/mvel2-2.4.2.Final.jar

That's the closest I could get, and it requires the paths in the
maven.ext.class.path system property to be resolved relative to the
project root (so that the relative paths to the JAR files will be
correct), and I don't even know if that's guaranteed.

So, it's a pretty tough sell at this point.

> > I tried adding the Priority annotation, and it works from Maven's
> > lib/ext, but it also works *without* it, so I'm hesitant to add it
> > unless I know it's really necessary.  The readme file in Maven's
> > lib/ext says
>
> Without it you dont deactivate default one - you can check it debugging it.

Hmm, how can I check it by debugging?  I tried without the Priority
annotation with a breakpoint in AdvancedProfileActivator.isActive, and
I looked at the caller DefaultProfileSelector.isActive frame, which is
one frame down in the stack, and I see the AdvancedProfileActivator in
the DefaultProfileSelector's activators list, and I don't see the
default PropertyProfileActivator.  Attached is a screenshot.  Maybe
I'm looking in the wrong place?

Thanks!

Lewis


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

Re: Extension does not work from .mvn/extensions.xml

2018-11-20 Thread Romain Manni-Bucau
Le mar. 20 nov. 2018 19:23, J. Lewis Muir  a écrit :

> On Tue, Nov 20, 2018 at 2:30 AM Romain Manni-Bucau
>  wrote:
> > 1. you have to use lib/ext folder and not extensions.xml cause it is
> loaded
> > too late
>
> Unfortunately, that's a deal breaker.  Using Maven's lib/ext is the
> original situation I reported when I started this thread (i.e., it
> worked from Maven's lib/ext, but not from the project's
> .mvn/extensions.xml.)  There's no way I can get the developers of the
> software I'm planning to use this in to install the extension in
> Maven's lib/ext; it has to be able to work from the project's
> .mvn/extensions.xml.  I guess this is the end of the road, then.
> Bummer.
>

Even with mvnsh, maven opts or the -D?


> > 2. you have to override the property activator as you mentionned cause
> > otherwise your profile is added (through plexus) in the list of
> activator,
> > set the activation to true and then property one sets it to false
> >
> > To do 2 you just have to use sisu @Priority and ensure the hint is
> property:
>
> I tried adding the Priority annotation, and it works from Maven's
> lib/ext, but it also works *without* it, so I'm hesitant to add it
> unless I know it's really necessary.  The readme file in Maven's
> lib/ext says
>

Without it you dont deactivate default one - you can check it debugging it.


>   Use this directory to contribute 3rd-party extensions to the Maven
>   core. These extensions can either extend or override Maven's default
>   implementation.
>
> Do I really need the Priority annotation, or will my extension's
> AdvancedProfileActivator (annotated with '@Component(role =
> ProfileActivator.class, hint = "property")') always take precedence
> over the default by virtue of being in Maven's lib/ext?
>

This kind of order is fragile so better to be deterministic ans more robust
imho


> Thank you!
>
> Lewis
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>


Re: Extension does not work from .mvn/extensions.xml

2018-11-20 Thread J. Lewis Muir
On Tue, Nov 20, 2018 at 2:30 AM Romain Manni-Bucau
 wrote:
> 1. you have to use lib/ext folder and not extensions.xml cause it is loaded
> too late

Unfortunately, that's a deal breaker.  Using Maven's lib/ext is the
original situation I reported when I started this thread (i.e., it
worked from Maven's lib/ext, but not from the project's
.mvn/extensions.xml.)  There's no way I can get the developers of the
software I'm planning to use this in to install the extension in
Maven's lib/ext; it has to be able to work from the project's
.mvn/extensions.xml.  I guess this is the end of the road, then.
Bummer.

> 2. you have to override the property activator as you mentionned cause
> otherwise your profile is added (through plexus) in the list of activator,
> set the activation to true and then property one sets it to false
>
> To do 2 you just have to use sisu @Priority and ensure the hint is property:

I tried adding the Priority annotation, and it works from Maven's
lib/ext, but it also works *without* it, so I'm hesitant to add it
unless I know it's really necessary.  The readme file in Maven's
lib/ext says

  Use this directory to contribute 3rd-party extensions to the Maven
  core. These extensions can either extend or override Maven's default
  implementation.

Do I really need the Priority annotation, or will my extension's
AdvancedProfileActivator (annotated with '@Component(role =
ProfileActivator.class, hint = "property")') always take precedence
over the default by virtue of being in Maven's lib/ext?

Thank you!

Lewis

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



Second MNG-6261

2018-11-20 Thread Robert Scholte

Looking for someone to second this fix.

thanks,
Robert

Relative parent POM resolution failing in 3.5.0 with complex multimodule  
builds

https://issues.apache.org/jira/browse/MNG-6261

https://github.com/apache/maven/pull/192/files

https://builds.apache.org/job/maven-box/job/maven/job/MNG-6261/

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



[maven-remote-resources] Pull request for MRRESOURCES-102

2018-11-20 Thread Jurrie Overgoor

Hello everyone,

Since the readme of the Maven remote resources plugin says this list is 
the main channel of communication, I thought I'd post here to ask 
attention to my pull request :)


https://github.com/apache/maven-remote-resources-plugin/pull/2 is 
basically implementing MRRESOURCES-102: filtering of non *.vm resources


I hope someone can review my PR and comment on it or hopefully merge it. 
Thanks!


A possible next step would be to have the filtering of *.vm files in a 
Maven file filter which could be included in 
maven-remote-resources-plugin. That way, filtering for both *.vm. and 
non *.vm files would be done using the same framework. But that's for 
next time ;)


With kind regards,

Jurrie


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



Re: Extension does not work from .mvn/extensions.xml

2018-11-20 Thread Romain Manni-Bucau
Ok so let me try to write a step by step:

1. you have to use lib/ext folder and not extensions.xml cause it is loaded
too late
2. you have to override the property activator as you mentionned cause
otherwise your profile is added (through plexus) in the list of activator,
set the activation to true and then property one sets it to false

To do 2 you just have to use sisu @Priority and ensure the hint is property:

@org.eclipse.sisu.Priority(1)
@Component(role = ProfileActivator.class, hint = "property")
public class AdvancedProfileActivator implements ProfileActivator {}


Romain Manni-Bucau
@rmannibucau  |  Blog
 | Old Blog
 | Github  |
LinkedIn  | Book



Le mar. 20 nov. 2018 à 05:56, J. Lewis Muir  a écrit :

> On Mon, Nov 19, 2018 at 4:16 PM Romain Manni-Bucau
>  wrote:
> > Time to push your code and an example on github to encourage help/people
> to
> > run it ;)
>
> OK, here's how to get the extension with the proof of concept code and
> install it locally:
>
> ===
> $ git clone https://github.com/imca-cat/profile-activation-advanced.git
> $ cd profile-activation-advanced
> $ git checkout lifecycle-participant-poc
> $ mvn clean install
> ===
>
> The proof of concept extension just changes the value of any profile
> property activation with a name of "paa:mvel" to the string "!false".
> It does not evaluate any MVEL expression at the moment; it's just a
> proof of concept for changing the model.  Since the system property
> "paa:mvel" is not defined, the altered property activation should
> evaluate to true, but I don't know how to get Maven to re-evaluate the
> property activations after I've changed them.
>
> And here's how to get and run a small test that uses the locally
> installed extension:
>
> ===
> $ git clone https://github.com/jlmuir/profile-activation-advanced-test.git
> $ cd profile-activation-advanced-test
> $ mvn help:active-profiles validate
> ===
>
> I'm expecting the "mvn help:active-profiles validate" command to show
> that the foo_env-development profile is active with output like
>
> ===
> The following profiles are active:
>
>  - foo_env-development (source: org.example.foo:foo:1.0.0)
> ===
>
> but it does not.  So, it seems the extension is not successfully
> changing the model (i.e., not successfully activating the
> foo_env-development profile).
>
> Thank you!
>
> Lewis
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
> For additional commands, e-mail: dev-h...@maven.apache.org
>
>