You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Gargan, Stephen" <sg...@qualcomm.com> on 2004/01/07 00:55:05 UTC

Building a list in a variable

I have a number of top level modules in an ear that I want the war to be
able to access but I do not want them included in the libs folder as
other modules also use them and I end up with classloader issues.
Typically what I have done to remedy this is to include the modules
required in a Class-Path variable in the war manifest. I have modified
the war plugin to check the war's dependencies for the a
manifest.classpath property and I want to concatenate the list of the
matching libs into a jelly variable that I can use to add a manifest
property as follows

 

<j:set var="manifestclasspath" value="" scope="parent"/>

      <j:forEach var="lib" items="${pom.artifacts}">

            <j:set var="dep" value="${lib.dependency}"/>     

            <j:if test="${dep.getProperty('manifest.classpath') !=
null}">

               <echo>Adding ${lib.name} to Class-Path</echo>

               <j:set var="manifestclasspath"
value="${manifestClasspath} ${lib.name}" scope="parent"/>

            </j:if>  

      </j:forEach>         

 

      <ant:manifest>

        <ant:attribute name="Built-By" value="${user.name}" />

        <ant:section name="${pom.package}">

          <ant:attribute name="Specification-Title"
value="${pom.artifactId}" />

          <ant:attribute name="Specification-Version"

                     value="${pom.currentVersion}" />

          <ant:attribute name="Specification-Vendor"

                     value="${pom.organization.name}" />

          <ant:attribute name="Implementation-Title"

                     value="${pom.package}" />

          <ant:attribute name="Implementation-Version"

                     value="${pom.currentVersion}" />

          <ant:attribute name="Implementation-Vendor"

                     value="${pom.organization.name}" />

          

        </ant:section>

            <ant:attribute name="Class-Path"

                     value="${manifestclasspath}" />

      </ant:manifest>

 

Although it finds and iterates through each of the marked dependencies
fine, resetting the manifestclasspath variable to add the new addition 

 

               <j:set var="manifestclasspath"
value="${manifestClasspath} ${lib.name}" scope="parent"/>

 

doesn't seem to work as it doesn't seem to resolve the manifestclasspath
variable and just overwrites the previous contents, leaving only the
last dependency in the variable.

 

Is there any way to build up a list like this? Any suggestions would be
greatly appreciated.

 

Thanks in advance

 

Stephen

 

------------------------------------

Stephen Gargan, IT Engineer

sgargan@qualcomm.com

------------------------------------

 


Re: Building a list in a variable

Posted by di...@multitask.com.au.
Yes.
--
dIon Gillard, Multitask Consulting
Blog:      http://blogs.codehaus.org/people/dion/



"Jefferson K. French" <je...@frenches.org> wrote on 07/01/2004 11:57:14 AM:

> On Tue, 6 Jan 2004, at 15:55:05 [GMT -0800] Gargan, Stephen wrote:
> 
> >                <j:set var="manifestclasspath"
> > value="${manifestClasspath} ${lib.name}" scope="parent"/>
> 
> The second reference to manifestclasspath is mixed case. Are variables
> case sensitive?
> 
>   Jeff
> 
> -- 
> mailto:jeff@frenches.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: Building a list in a variable

Posted by "Jefferson K. French" <je...@frenches.org>.
On Tue, 6 Jan 2004, at 15:55:05 [GMT -0800] Gargan, Stephen wrote:

>                <j:set var="manifestclasspath"
> value="${manifestClasspath} ${lib.name}" scope="parent"/>

The second reference to manifestclasspath is mixed case. Are variables
case sensitive?

  Jeff

-- 
mailto:jeff@frenches.org



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