You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James CE Johnson <jc...@tragus.org> on 2003/10/30 14:56:47 UTC

Using jelly script in project.xml

This bit from project.xml:


  <dependencies>
    <maven:pom var="pom"
               projectDescriptor="${basedir}/../view/project.xml"/>
    <j:forEach var="dep" items="${pom.dependencies}">
      <j:if test="${dep.getProperty('war.bundle')=='true'}">
        <dependency>
          <id>${dep.id}</id>
          <groupId>${dep.groupId}</groupId>
          <version>${dep.version}</version>
        </dependency>
      </j:if>
    </j:forEach>
  </dependencies>

And this bit from maven.xml:

  <goal name="foo">
    <j:forEach var="dep" items="${pom.dependencies}">
      <echo message="${dep.id}"/>
    </j:forEach>
  </goal>

Doesn't produce what I was hoping for. That is, I want this project's
project.xml to include in its dependencies everything marked 'war.bundle'
in ../view/project.xml. The 'foo' goal doesn't show any such thing.

Is a completely stupid thing to do or am I just doing it the wrong way?

Thanks,
J


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


Re: Using jelly script in project.xml

Posted by James CE Johnson <jc...@tragus.org>.
> We use the user's home build.properties to insert values into
> project.xml, so these are obviously available as well.
>
> [~/build.properties]
> my.cvs.userid=matt
> my.cvs.server=cvs
> my.cvs.root=/cvsroot
>
> [project.xml]
> <repository>
> <developerConnection>scm:cvs:ext:${my.cvs.userid}@${my.cvs.server}:${my.cvs.root}:/my/module</developerConnection>
> </repository>
>
> I don't imagine it would be difficult (although I haven't tested it) to
> do something similar with the version element of dependencies.

Yeabut...

I don't want every developer on the team to have to maintain the version
numbers in their own ~/build.properties.

What I would really like to do is use <property> or <j:set> in project.xml
to set the version numbers of dependencies that are listed in several
subprojects' project.xml. I've tried everything I can think of but it just
doesn't work. (Even better... set those versions in the top-level
project.properties when said file becomes inherited by subprojects!)

>
>
> Matt
>
> dion@multitask.com.au wrote:
>
>>The project.xml can use variables defined in the pom, like you have
>> mentioned below.
>>
>>I'm not sure which other properties are available at interpolation
>> time. --
>>dIon Gillard, Multitask Consulting
>>Blog:      http://blogs.codehaus.org/people/dion/
>>Pub Key:http://blogs.codehaus.org/people/dion/public-key.asc
>>
>>
>>Stephen McConnell <mc...@apache.org> wrote on 31/10/2003 07:48:00
>> AM:
>>
>>
>>
>>>James CE Johnson wrote:
>>>
>>>
>>>
>>>>>The project.xml file isn't executed as a jelly script. It's treated
>>>>> as an  expression.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>Drat.
>>>>
>>>>I guess that also explains why I can't set properties/variables in
>>>> maven.xml and have them evaluated in project.xml:
>>>>
>>>>maven.xml:
>>>>
>>>>  ...
>>>>  <property name="foo.version" value="1.2.3"/>
>>>>
>>>>project.xml:
>>>>
>>>>  <dependency>
>>>>     <id>foo</id>
>>>>     <version>${foo.version}</version>
>>>>  </dependency>
>>>>
>>>>
>>>>
>>>>
>>>This (parameterized versions) would be *so* helpful!
>>>
>>>Steve.
>>>
>>>
>>>
>>>>---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>--
>>>
>>>Stephen J. McConnell
>>>mailto:mcconnell@apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


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


Re: Using jelly script in project.xml

Posted by matt <jo...@whitesmiths.com.au>.
We use the user's home build.properties to insert values into 
project.xml, so these are obviously available as well. 

[~/build.properties]
my.cvs.userid=matt
my.cvs.server=cvs
my.cvs.root=/cvsroot

[project.xml]
<repository>
<developerConnection>scm:cvs:ext:${my.cvs.userid}@${my.cvs.server}:${my.cvs.root}:/my/module</developerConnection>
</repository>

I don't imagine it would be difficult (although I haven't tested it) to 
do something similar with the version element of dependencies.


Matt

dion@multitask.com.au wrote:

>The project.xml can use variables defined in the pom, like you have 
>mentioned below.
>
>I'm not sure which other properties are available at interpolation time.
>--
>dIon Gillard, Multitask Consulting
>Blog:      http://blogs.codehaus.org/people/dion/
>Pub Key:http://blogs.codehaus.org/people/dion/public-key.asc
>
>
>Stephen McConnell <mc...@apache.org> wrote on 31/10/2003 07:48:00 AM:
>
>  
>
>>James CE Johnson wrote:
>>
>>    
>>
>>>>The project.xml file isn't executed as a jelly script. It's treated as
>>>>an  expression.
>>>>
>>>>
>>>>        
>>>>
>>>Drat.
>>>
>>>I guess that also explains why I can't set properties/variables in
>>>maven.xml and have them evaluated in project.xml:
>>>
>>>maven.xml:
>>>
>>>  ...
>>>  <property name="foo.version" value="1.2.3"/>
>>>
>>>project.xml:
>>>
>>>  <dependency>
>>>     <id>foo</id>
>>>     <version>${foo.version}</version>
>>>  </dependency>
>>>
>>>
>>>      
>>>
>>This (parameterized versions) would be *so* helpful!
>>
>>Steve.
>>
>>    
>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>-- 
>>
>>Stephen J. McConnell
>>mailto:mcconnell@apache.org
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>  
>


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


Re: Using jelly script in project.xml

Posted by di...@multitask.com.au.
The project.xml can use variables defined in the pom, like you have 
mentioned below.

I'm not sure which other properties are available at interpolation time.
--
dIon Gillard, Multitask Consulting
Blog:      http://blogs.codehaus.org/people/dion/
Pub Key:http://blogs.codehaus.org/people/dion/public-key.asc


Stephen McConnell <mc...@apache.org> wrote on 31/10/2003 07:48:00 AM:

> 
> 
> James CE Johnson wrote:
> 
> >>The project.xml file isn't executed as a jelly script. It's treated as
> >>an  expression.
> >> 
> >>
> >
> >Drat.
> >
> >I guess that also explains why I can't set properties/variables in
> >maven.xml and have them evaluated in project.xml:
> >
> >maven.xml:
> >
> >   ...
> >   <property name="foo.version" value="1.2.3"/>
> >
> >project.xml:
> >
> >   <dependency>
> >      <id>foo</id>
> >      <version>${foo.version}</version>
> >   </dependency>
> > 
> >
> 
> This (parameterized versions) would be *so* helpful!
> 
> Steve.
> 
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> > 
> >
> 
> -- 
> 
> Stephen J. McConnell
> mailto:mcconnell@apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: Using jelly script in project.xml

Posted by Stephen McConnell <mc...@apache.org>.

James CE Johnson wrote:

>>The project.xml file isn't executed as a jelly script. It's treated as
>>an  expression.
>>    
>>
>
>Drat.
>
>I guess that also explains why I can't set properties/variables in
>maven.xml and have them evaluated in project.xml:
>
>maven.xml:
>
>   ...
>   <property name="foo.version" value="1.2.3"/>
>
>project.xml:
>
>   <dependency>
>      <id>foo</id>
>      <version>${foo.version}</version>
>   </dependency>
>  
>

This (parameterized versions) would be *so* helpful!

Steve.

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

-- 

Stephen J. McConnell
mailto:mcconnell@apache.org




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


Re: Using jelly script in project.xml

Posted by James CE Johnson <jc...@tragus.org>.
> The project.xml file isn't executed as a jelly script. It's treated as
> an  expression.

Drat.

I guess that also explains why I can't set properties/variables in
maven.xml and have them evaluated in project.xml:

maven.xml:

   ...
   <property name="foo.version" value="1.2.3"/>

project.xml:

   <dependency>
      <id>foo</id>
      <version>${foo.version}</version>
   </dependency>


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


Re: Using jelly script in project.xml

Posted by di...@multitask.com.au.
The project.xml file isn't executed as a jelly script. It's treated as an 
expression.
--
dIon Gillard, Multitask Consulting
Blog:      http://blogs.codehaus.org/people/dion/
Pub Key:http://blogs.codehaus.org/people/dion/public-key.asc


"James CE Johnson" <jc...@tragus.org> wrote on 31/10/2003 06:06:44 AM:

> > Hi James,
> >
> > can you tell me if you succeeded with this approach?!
> 
> No luck so far :-(
> 
> I can't quite figure out when the jelly script is executed in the
> project.xml lifecycle. From what I can tell, though, its after the 
${pom}
> has already been populated because my script below had absolutely no
> effect on the actual list of dependencies.
> 
> > I actually
> > thought of using JELLY scripting to pull in dependencies but you end 
up
> > with a "non-XML" file. In my case we thought of autogenerating the 
WSAD
> > (Websphere Application Studio) project files based on the POM  similar
> > to that what MEVENIDE does (or should do)
> >
> > Thanks in advance,
> >
> > Siegfried Goeschl
> >
> > On 30 Oct 2003 at 8:56, James CE Johnson wrote:
> >
> >> This bit from project.xml:
> >>
> >>
> >>   <dependencies>
> >>     <maven:pom var="pom"
> >>                projectDescriptor="${basedir}/../view/project.xml"/>
> >>     <j:forEach var="dep" items="${pom.dependencies}">
> >>       <j:if test="${dep.getProperty('war.bundle')=='true'}">
> >>         <dependency>
> >>           <id>${dep.id}</id>
> >>           <groupId>${dep.groupId}</groupId>
> >>           <version>${dep.version}</version>
> >>         </dependency>
> >>       </j:if>
> >>     </j:forEach>
> >>   </dependencies>
> >>
> >> And this bit from maven.xml:
> >>
> >>   <goal name="foo">
> >>     <j:forEach var="dep" items="${pom.dependencies}">
> >>       <echo message="${dep.id}"/>
> >>     </j:forEach>
> >>   </goal>
> >>
> >> Doesn't produce what I was hoping for. That is, I want this project's
> >> project.xml to include in its dependencies everything marked
> >> 'war.bundle' in ../view/project.xml. The 'foo' goal doesn't show any
> >> such thing.
> >>
> >> Is a completely stupid thing to do or am I just doing it the wrong
> >> way?
> >>
> >> Thanks,
> >> J
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For
> >> additional commands, e-mail: users-help@maven.apache.org
> >>
> >
> >
> >
> > Siegfried Goeschl
> > CTO
> > =================================
> > IT20one GmbH
> > mail: siegfried.goeschl@it20one.at
> > phone: +43-1-9900046
> > fax: +43-1-52 37 888
> > www.it20one.at
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


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


Re: Using jelly script in project.xml

Posted by James CE Johnson <jc...@tragus.org>.
> Hi James,
>
> can you tell me if you succeeded with this approach?!

No luck so far :-(

I can't quite figure out when the jelly script is executed in the
project.xml lifecycle. From what I can tell, though, its after the ${pom}
has already been populated because my script below had absolutely no
effect on the actual list of dependencies.

> I actually
> thought of using JELLY scripting to pull in dependencies but you end  up
> with a "non-XML" file. In my case we thought of autogenerating the  WSAD
> (Websphere Application Studio) project files based on the POM  similar
> to that what MEVENIDE does (or should do)
>
> Thanks in advance,
>
> Siegfried Goeschl
>
> On 30 Oct 2003 at 8:56, James CE Johnson wrote:
>
>> This bit from project.xml:
>>
>>
>>   <dependencies>
>>     <maven:pom var="pom"
>>                projectDescriptor="${basedir}/../view/project.xml"/>
>>     <j:forEach var="dep" items="${pom.dependencies}">
>>       <j:if test="${dep.getProperty('war.bundle')=='true'}">
>>         <dependency>
>>           <id>${dep.id}</id>
>>           <groupId>${dep.groupId}</groupId>
>>           <version>${dep.version}</version>
>>         </dependency>
>>       </j:if>
>>     </j:forEach>
>>   </dependencies>
>>
>> And this bit from maven.xml:
>>
>>   <goal name="foo">
>>     <j:forEach var="dep" items="${pom.dependencies}">
>>       <echo message="${dep.id}"/>
>>     </j:forEach>
>>   </goal>
>>
>> Doesn't produce what I was hoping for. That is, I want this project's
>> project.xml to include in its dependencies everything marked
>> 'war.bundle' in ../view/project.xml. The 'foo' goal doesn't show any
>> such thing.
>>
>> Is a completely stupid thing to do or am I just doing it the wrong
>> way?
>>
>> Thanks,
>> J
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For
>> additional commands, e-mail: users-help@maven.apache.org
>>
>
>
>
> Siegfried Goeschl
> CTO
> =================================
> IT20one GmbH
> mail: siegfried.goeschl@it20one.at
> phone: +43-1-9900046
> fax: +43-1-52 37 888
> www.it20one.at


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


Re: Using jelly script in project.xml

Posted by Siegfried Göschl <si...@it20one.at>.
Hi James,

can you tell me if you succeeded with this approach?! I actually 
thought of using JELLY scripting to pull in dependencies but you end 
up with a "non-XML" file. In my case we thought of autogenerating the 
WSAD (Websphere Application Studio) project files based on the POM 
similar to that what MEVENIDE does (or should do)

Thanks in advance,

Siegfried Goeschl

On 30 Oct 2003 at 8:56, James CE Johnson wrote:

> This bit from project.xml:
> 
> 
>   <dependencies>
>     <maven:pom var="pom"
>                projectDescriptor="${basedir}/../view/project.xml"/>
>     <j:forEach var="dep" items="${pom.dependencies}">
>       <j:if test="${dep.getProperty('war.bundle')=='true'}">
>         <dependency>
>           <id>${dep.id}</id>
>           <groupId>${dep.groupId}</groupId>
>           <version>${dep.version}</version>
>         </dependency>
>       </j:if>
>     </j:forEach>
>   </dependencies>
> 
> And this bit from maven.xml:
> 
>   <goal name="foo">
>     <j:forEach var="dep" items="${pom.dependencies}">
>       <echo message="${dep.id}"/>
>     </j:forEach>
>   </goal>
> 
> Doesn't produce what I was hoping for. That is, I want this project's
> project.xml to include in its dependencies everything marked
> 'war.bundle' in ../view/project.xml. The 'foo' goal doesn't show any
> such thing.
> 
> Is a completely stupid thing to do or am I just doing it the wrong
> way?
> 
> Thanks,
> J
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For
> additional commands, e-mail: users-help@maven.apache.org
> 



Siegfried Goeschl
CTO
=================================
IT20one GmbH
mail: siegfried.goeschl@it20one.at
phone: +43-1-9900046
fax: +43-1-52 37 888
www.it20one.at

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