maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ansgar Konermann <ansgar.konerm...@googlemail.com>
Subject Re: How can I tell if I'm building the parent or a module?
Date Mon, 12 Sep 2011 20:03:02 GMT
Am 12.09.2011 21:50, schrieb laredotornado-3:
> Hi,
>
> I'm using Maven 3.0.3.  Within an antrun execution, how can I tell if I'm
> building a parent or building one of the modules that inherits from the
> parent?  This antrun execution is located within the parent pom.xml file.

Put the following task into your antrun plugin configuration:

<echo>Running from project ${project.groupId}:${project.artifactId}</echo>

Why does this work? Even though the plugin configuration is inherited
from the parent, the properties are resolved in the context of the
actually executing POM, that is: if the plugin runs in the child module,
you'll get the child module's groupId and  artifactId printed.

Best regards

Ans

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


Mime
View raw message