You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by David Zeleznik <dz...@ilog.com> on 2003/04/01 20:03:21 UTC

Defining goals in imported scripts

Hi Yet Again,

This may be more of a Jelly question than Maven, I am not sure. We have a
large maven.xml that is associated with our template project.xml. We have
been adding many common goals, etc. to this template maven.xml and it has
gotten larger and larger. We are now trying to break maven.xml up into
smaller scripts that are imported by maven.xml. This is where we are
encountering some type of goal scoping behavior that we do not completely
understand. For example...

doit.jelly looks like this:

<project>
  <goal name="doit">
    <echo>You asked me to do it!</echo>
  </goal>
</project>

Now, if my maven.xml directly imports doit.jelly:

<project
  xmlns:j="jelly:core" >
  <j:import file="doit.jelly" inherit="true" />
</project>

The doit goal is not defined and I cannot execute "maven doit". However, if
I import the nested script within the context of a goal I can attain goals
in the nested script. Here is the revised maven.xml:

<project
  xmlns:j="jelly:core" >
  <goal name="reallyDoit">
    <j:import file="doit.jelly" inherit="true" />
    <attainGoal name="doit"/>
  </goal>
</project>

Now, I can successfully execute "maven reallyDoit" and the doit goal is
attained. Can someone explain this to me, is this expected behavior? Thanks,

--------------------------------------
David Zeleznik
ILOG - Changing the rules of business
mailto:dzeleznik@ilog.com
http://www.ilog.com
--------------------------------------


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