Hey,

I was working on a Mojo on which I thought would be a trivial problem. 
Though it turns out it's not.

I simply want to add a property file during the phase "generate-resources"
with the current version, on the classpath.  Ideally it's located at the
default resourcesdir.  The name of the props file needs to be the name of
the artifact (or the given name).

For one, I was looking for a maven property like
${build.rescourceDirectory}.  But I couldn't find it.  It's of course kind
of logical as It's not guaranteed to be only one directory.  But that's not
the main reason of this thread.

The other triviality seems to be setting a parameter to use a default-value
for this but it doesn't work, or at least it returns null.

the properties, which of course exist in maven and don't work in the mojo,
are: 

    /**
     * @parameter expression="${versionprop.appName}"
default-value="${build.artifactId}"
     */
    private String appName;


    /**
     * @parameter expression="${versionprop.name}" default-value="${name}"
     */
    private String name;

 /**
     * @parameter expression="${versionprop.test}"
default-value="${artifactId}"
     */
    private String test;

I do find this very odd to say the least.  I'd expect to be able to use
every expression value used in maven in a Mojo.

I know it's really simple to just put these values in the configuration
section, however it would really be better if it would work without config
to minimize overhead and human errors.


Any idea's?

Thanks!

-- 
View this message in context: 
http://maven.40175.n5.nabble.com/possible-expressions-on-MOJO-parameters-tp3290963p3290963.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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

Reply via email to