You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by BrunoF <br...@temis.com> on 2010/02/11 16:16:24 UTC

Enforce property existence before dependency resolution

Hi,

I am using Maven in the context of the build of a cross-plateform C++
application.
It means that, in my own Maven repository, I have zip-artifacts containing
several DLL or so files like:
  boost:boost_regex:1.34.1:zip

In order to distinguish between plateforms, I use the classifier and I
actually have these artifacts:
  boost:boost_regex:1.34.1:zip:x86-windows-vc8
or: 
  boost:boost_regex:1.34.1:zip:x86-linux2.6-gcc3.3

That's to say I have 1 zip for windows, another one for linux...

It means that the dependency section of my POM looks like:
  <dependency>
    <groupId>boost_regex</groupId>
    <artifactId>boost_regex</artifactId>
    <version>1.34.1</version>
    <classifier>${target.platform}</classifier>
    <type>zip</type>
  </dependency>

This works great if I specify a -Dtarget.plateform=x86-linux2.6-gcc3.3
option on Maven command-line.

I would like to use the enforcer plugin to ensure that the "target.platform"
property has been defined before running the build. 
However it seems that the dependency resolution comes before the execution
of enforcer. In the end, when I "forget" the property on the command-line, I
don't get an explicit error message from enforcer but rather a Maven message
telling me that the boost:boost_regex:1.34.1:zip:${target.platform} does not
exist.

Do you know how I can make sure that the ${target.platform} property has
been defined before running into the dependency resolution process?
I've tried several things (like putting the enforcer in a parent POM of my
current POM) but none of them worked.

Many thanks in advance for your answers,

Cheers,

Bruno.


-- 
View this message in context: http://old.nabble.com/Enforce-property-existence-before-dependency-resolution-tp27547470p27547470.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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