Extension does not work from .mvn/extensions.xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Extension does not work from .mvn/extensions.xml

J. Lewis Muir
Hello, all!

I little under two weeks ago, I posted with the subject "Extension works
from lib/ext and CLI but not extensions.xml"


Now I have reluctantly forked that extension to create my own


and have published to the Central Repository.

Unfortunately, the same problem persists.  But at least now there can
be no question about trying to use an extension fetched from my local
repository that had not been published to the Central Repository, and
hopefully it will be easier for someone to try this and help figure out
what's wrong (i.e., no need to build the extension).

The extension works if I put its JAR in Maven's lib/ext directory, but
it does not work when loaded via a project's .mvn/extensions.xml file.
Having it work from .mvn/extensions.xml is critical for my intended use.
Does anyone know why it doesn't work or what I could do to figure out
why it doesn't work?

To reproduce the problem, simply create a new Maven project directory
containing the following pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
          <value>(!isdef foo_env) || foo_env == "development"</value>

Then create .mvn/extensions.xml:

<?xml version="1.0" encoding="UTF-8"?>
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0"

Then run the following command:

$ mvn help:active-profiles validate

It should report that the foo_env-development profile is active

The following profiles are active:

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

but it does not

The following profiles are active:

If I place the extension's JAR file (and the JAR file for its mvel2
dependency) in Maven's lib/ext directory, it works: the command reports
that the foo_env-development profile is active, which is the correct

Thank you to anyone who can help!


To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]