Re: Extension works from lib/ext and CLI but not extensions.xml

2018-10-27 Thread J. Lewis Muir
On 10/26, J. Lewis Muir wrote:
> This is Maven 3.5.4, the latest Git snapshot of EL Profile Activation
> Maven Extension, and MVEL 2.4.2.Final.

To head off any confusion for anyone looking closely at the transcripts,
the Git snapshot of EL Profile Activation Maven Extension that I used
was c3b490a, but I realized I made one change after cloning: I changed
the version of the mvel2 dependency in pom.xml from "2.3.0.Final" to
"2.4.2.Final" (one of my many shot-in-the-dark attempts at getting it to
work).  So, the transcripts are with the el-profile-activator-extension
artifact built with this change.

Lewis

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



Re: Extension works from lib/ext and CLI but not extensions.xml

2018-10-27 Thread J. Lewis Muir
On 10/26, Mirko Friedenhagen wrote:
> Hello,
> 
> I think extensions are looked up in pluginRepositories, not the
> standard repositories. Maybe that’s your problem?
> 
> Best Regards 
> Mirko Friedenhagen

Thank you for your suggestion.  How can I test this hypothesis?
I do not have a ~/.m2/settings.xml file, so there are no custom
repositories there, and the test-01 project's pom.xml does not contain
any custom repositories.  I'm just depending on Maven being able to
find in my local repository (~/.m2/repository) the extension listed
in extensions.xml.  I don't see any errors in the transcript for the
"-X" invocation that would suggest it wasn't able to find the extension
artifact; it's just that the extension doesn't work when loaded from
extensions.xml.

I tried hacking

  
~/.m2/repository/com/redhat/jboss/maven/el-profile-activator-extension/1.0.0/_remote.repositories

which contained

  el-profile-activator-extension-1.0.0.pom>=
  el-profile-activator-extension-1.0.0.jar>=

by making it look like the artifact came from Maven Central

  el-profile-activator-extension-1.0.0.pom>central=
  el-profile-activator-extension-1.0.0.jar>central=

but that didn't help; the extension still didn't work when loaded via
extensions.xml.

Lewis

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



Re: Extension works from lib/ext and CLI but not extensions.xml

2018-10-27 Thread J. Lewis Muir
On 10/26, Matthieu BROUILLARD wrote:
> Not sure but I think the mechanism extension does not work for SNAPSHOT
> versions.
> Try to install a non SNAPSHOT version in your local maven repository.

Thank you for the suggestion!  I took "-SNAPSHOT" out of the version and
installed it in my local repository and used it in extensions.xml, but
no dice, it still doesn't work. :-(

Lewis

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



Re: Extension works from lib/ext and CLI but not extensions.xml

2018-10-26 Thread Mirko Friedenhagen
Hello,

I think extensions are looked up in pluginRepositories, not the standard 
repositories. Maybe that’s your problem?

Best Regards 
Mirko Friedenhagen
— 
Sent from my mobile 

Am 26.10.18 um 17:41 schrieb Karl Heinz Marbaise

> Hi,
> 
> On 26/10/18 10:16, Matthieu BROUILLARD wrote:
> > Not sure but I think the mechanism extension does not work for SNAPSHOT
> > versions.
> 
> 
> No. There is something else different/wrong...
> 
> 
> > Try to install a non SNAPSHOT version in your local maven repository.
> > I think I have already faced the same in the past while producing with my
> > own extension https://github.com/jgitver/jgitver-maven-plugin
> > 
> > Hope it helps.
> > 
> > Matthieu
> > 
> > On Fri, Oct 26, 2018 at 7:39 AM J. Lewis Muir  wrote:
> > 
> >> Hello, all!
> >>
> >> I'm trying to use the EL Profile Activation Maven Extension
> >>
> >>https://github.com/kpiwko/el-profile-activator-extension
> >>
> >> to activate a profile when the foo_env system property is either not
> >> set, or set to "development".  I'm using the "help:active-profiles" goal
> >> of the Maven Help plugin and the "validate" phase to test whether or not
> >> a profile is active.
> >>
> >> The extension works when I install it in
> >>
> >>/lib/ext
> >>
> >> and it works when I specify it on the command line with
> >>
> >>-Dmaven.ext.class.path=
> >>
> >> but it does *not* work when I put it in the project's
> >>
> >>.mvn/extensions.xml
> >>
> >> Does anyone know why?!
> >>
> >> This is Maven 3.5.4, the latest Git snapshot of EL Profile Activation
> >> Maven Extension, and MVEL 2.4.2.Final.
> >>
> >> The el-profile-activator-extension artifact is not published in the
> >> Central Repository, but I installed it into my local repository (i.e.,
> >> ~/.m2/repository) with
> >>
> >>git clone https://github.com/kpiwko/el-profile-activator-extension.git
> >>cd el-profile-activator-extension
> >>: JAVA_HOME has been set to a Java 8 SDK to compile
> >>mvn install
> >>
> >> That should be fine, right?  My local repository will be searched first
> >> for any artifacts listed in extensions.xml, and I don't get a warning
> >> nor error about it not being found, so my understanding is that this is
> >> OK.
> >>
> >> For the case where the extension does not work, I have a test-01 project
> >> directory containing the following pom.xml file
> >>
> >>
> >>http://maven.apache.org/POM/4.0.0;
> >>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> >>xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> >>http://maven.apache.org/xsd/maven-4.0.0.xsd;>
> >>  4.0.0
> >>  org.example.foo
> >>  foo
> >>  1.0.0
> >>  pom
> >>  
> >>
> >>  foo_env-development
> >>  
> >>
> >>  mvel
> >>  (!isdef foo_env) || (isdef foo_env  foo_env
> >> == "development")
> >>
> >>  
> >>
> >>  
> >>
> >>
> >> and the following .mvn/extensions.xml file
> >>
> >>http://maven.apache.org/EXTENSIONS/1.0.0;
> >>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> >>xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0
> >>http://maven.apache.org/xsd/core-extensions-1.0.0.xsd;>
> >>  
> >>com.redhat.jboss.maven
> >>el-profile-activator-extension
> >>1.0.0-SNAPSHOT
> >>  
> >>
> >>
> >> I invoke Maven like this
> >>
> >>mvn help:active-profiles validate
> >>
> >> and it shows that the foo_env-development profile is not active (i.e.,
> >> it lists no active profiles)
> >>
> >>The following profiles are active:
> >>
> >> but it should be!
> >>
> >> A transcript of this and with the "-X" option is attached as
> >>
> >>test-01-extensions-dot-xml.txt
> >>
> >> Removing the .mvn directory and adding
> >>
> >>el-profile-activator-extension-1.0.0-SNAPSHOT.jar
> >>
> >> and
> >>
> >>mvel2-2.4.2.Final.jar
> >>
> >> to
> >>
> >>/lib/ext
> >>
> >> works; i.e., it shows that the foo_env-development profile is active
> >>
> >>The following profiles are active:
> >>
> >> - foo_env-development (source: org.example.foo:foo:1.0.0)
> >>
> >> A transcript of this and with the "-X" option is attached as
> >>
> >>test-01-maven-home-lib-ext.txt
> >>
> >> Removing those JARs from
> >>
> >>/lib/ext
> >>
> >> and instead specifying them on the command line by setting the
> >>
> >>maven.ext.class.path
> >>
> >> system property works; i.e., it shows that the foo_env-development
> >> profile is active
> >>
> >>The following profiles are active:
> >>
> >> - foo_env-development (source: org.example.foo:foo:1.0.0)
> >>
> >> A transcript of this and with the "-X" option is attached as
> >>
> >>test-01-maven-ext-class-path.txt
> >>
> >> Any help getting the extensions.xml case to work would be greatly
> >> appreciated!  Thank you!
> >>
> >> Lewis
> 
> 

Re: Extension works from lib/ext and CLI but not extensions.xml

2018-10-26 Thread Karl Heinz Marbaise

Hi,

On 26/10/18 10:16, Matthieu BROUILLARD wrote:

Not sure but I think the mechanism extension does not work for SNAPSHOT
versions.



No. There is something else different/wrong...



Try to install a non SNAPSHOT version in your local maven repository.
I think I have already faced the same in the past while producing with my
own extension https://github.com/jgitver/jgitver-maven-plugin

Hope it helps.

Matthieu

On Fri, Oct 26, 2018 at 7:39 AM J. Lewis Muir  wrote:


Hello, all!

I'm trying to use the EL Profile Activation Maven Extension

   https://github.com/kpiwko/el-profile-activator-extension

to activate a profile when the foo_env system property is either not
set, or set to "development".  I'm using the "help:active-profiles" goal
of the Maven Help plugin and the "validate" phase to test whether or not
a profile is active.

The extension works when I install it in

   /lib/ext

and it works when I specify it on the command line with

   -Dmaven.ext.class.path=

but it does *not* work when I put it in the project's

   .mvn/extensions.xml

Does anyone know why?!

This is Maven 3.5.4, the latest Git snapshot of EL Profile Activation
Maven Extension, and MVEL 2.4.2.Final.

The el-profile-activator-extension artifact is not published in the
Central Repository, but I installed it into my local repository (i.e.,
~/.m2/repository) with

   git clone https://github.com/kpiwko/el-profile-activator-extension.git
   cd el-profile-activator-extension
   : JAVA_HOME has been set to a Java 8 SDK to compile
   mvn install

That should be fine, right?  My local repository will be searched first
for any artifacts listed in extensions.xml, and I don't get a warning
nor error about it not being found, so my understanding is that this is
OK.

For the case where the extension does not work, I have a test-01 project
directory containing the following pom.xml file

   
   http://maven.apache.org/POM/4.0.0;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
   http://maven.apache.org/xsd/maven-4.0.0.xsd;>
 4.0.0
 org.example.foo
 foo
 1.0.0
 pom
 
   
 foo_env-development
 
   
 mvel
 (!isdef foo_env) || (isdef foo_env  foo_env
== "development")
   
 
   
 
   

and the following .mvn/extensions.xml file

   http://maven.apache.org/EXTENSIONS/1.0.0;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0
   http://maven.apache.org/xsd/core-extensions-1.0.0.xsd;>
 
   com.redhat.jboss.maven
   el-profile-activator-extension
   1.0.0-SNAPSHOT
 
   

I invoke Maven like this

   mvn help:active-profiles validate

and it shows that the foo_env-development profile is not active (i.e.,
it lists no active profiles)

   The following profiles are active:

but it should be!

A transcript of this and with the "-X" option is attached as

   test-01-extensions-dot-xml.txt

Removing the .mvn directory and adding

   el-profile-activator-extension-1.0.0-SNAPSHOT.jar

and

   mvel2-2.4.2.Final.jar

to

   /lib/ext

works; i.e., it shows that the foo_env-development profile is active

   The following profiles are active:

- foo_env-development (source: org.example.foo:foo:1.0.0)

A transcript of this and with the "-X" option is attached as

   test-01-maven-home-lib-ext.txt

Removing those JARs from

   /lib/ext

and instead specifying them on the command line by setting the

   maven.ext.class.path

system property works; i.e., it shows that the foo_env-development
profile is active

   The following profiles are active:

- foo_env-development (source: org.example.foo:foo:1.0.0)

A transcript of this and with the "-X" option is attached as

   test-01-maven-ext-class-path.txt

Any help getting the extensions.xml case to work would be greatly
appreciated!  Thank you!

Lewis


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



Re: Extension works from lib/ext and CLI but not extensions.xml

2018-10-26 Thread Matthieu BROUILLARD
Not sure but I think the mechanism extension does not work for SNAPSHOT
versions.
Try to install a non SNAPSHOT version in your local maven repository.
I think I have already faced the same in the past while producing with my
own extension https://github.com/jgitver/jgitver-maven-plugin

Hope it helps.

Matthieu

On Fri, Oct 26, 2018 at 7:39 AM J. Lewis Muir  wrote:

> Hello, all!
>
> I'm trying to use the EL Profile Activation Maven Extension
>
>   https://github.com/kpiwko/el-profile-activator-extension
>
> to activate a profile when the foo_env system property is either not
> set, or set to "development".  I'm using the "help:active-profiles" goal
> of the Maven Help plugin and the "validate" phase to test whether or not
> a profile is active.
>
> The extension works when I install it in
>
>   /lib/ext
>
> and it works when I specify it on the command line with
>
>   -Dmaven.ext.class.path=
>
> but it does *not* work when I put it in the project's
>
>   .mvn/extensions.xml
>
> Does anyone know why?!
>
> This is Maven 3.5.4, the latest Git snapshot of EL Profile Activation
> Maven Extension, and MVEL 2.4.2.Final.
>
> The el-profile-activator-extension artifact is not published in the
> Central Repository, but I installed it into my local repository (i.e.,
> ~/.m2/repository) with
>
>   git clone https://github.com/kpiwko/el-profile-activator-extension.git
>   cd el-profile-activator-extension
>   : JAVA_HOME has been set to a Java 8 SDK to compile
>   mvn install
>
> That should be fine, right?  My local repository will be searched first
> for any artifacts listed in extensions.xml, and I don't get a warning
> nor error about it not being found, so my understanding is that this is
> OK.
>
> For the case where the extension does not work, I have a test-01 project
> directory containing the following pom.xml file
>
>   
>   http://maven.apache.org/POM/4.0.0;
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
>   http://maven.apache.org/xsd/maven-4.0.0.xsd;>
> 4.0.0
> org.example.foo
> foo
> 1.0.0
> pom
> 
>   
> foo_env-development
> 
>   
> mvel
> (!isdef foo_env) || (isdef foo_env  foo_env
> == "development")
>   
> 
>   
> 
>   
>
> and the following .mvn/extensions.xml file
>
>   http://maven.apache.org/EXTENSIONS/1.0.0;
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
>   xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0
>   http://maven.apache.org/xsd/core-extensions-1.0.0.xsd;>
> 
>   com.redhat.jboss.maven
>   el-profile-activator-extension
>   1.0.0-SNAPSHOT
> 
>   
>
> I invoke Maven like this
>
>   mvn help:active-profiles validate
>
> and it shows that the foo_env-development profile is not active (i.e.,
> it lists no active profiles)
>
>   The following profiles are active:
>
> but it should be!
>
> A transcript of this and with the "-X" option is attached as
>
>   test-01-extensions-dot-xml.txt
>
> Removing the .mvn directory and adding
>
>   el-profile-activator-extension-1.0.0-SNAPSHOT.jar
>
> and
>
>   mvel2-2.4.2.Final.jar
>
> to
>
>   /lib/ext
>
> works; i.e., it shows that the foo_env-development profile is active
>
>   The following profiles are active:
>
>- foo_env-development (source: org.example.foo:foo:1.0.0)
>
> A transcript of this and with the "-X" option is attached as
>
>   test-01-maven-home-lib-ext.txt
>
> Removing those JARs from
>
>   /lib/ext
>
> and instead specifying them on the command line by setting the
>
>   maven.ext.class.path
>
> system property works; i.e., it shows that the foo_env-development
> profile is active
>
>   The following profiles are active:
>
>- foo_env-development (source: org.example.foo:foo:1.0.0)
>
> A transcript of this and with the "-X" option is attached as
>
>   test-01-maven-ext-class-path.txt
>
> Any help getting the extensions.xml case to work would be greatly
> appreciated!  Thank you!
>
> Lewis
>
> -
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org