> On Wed, 2003-03-19 at 14:06, James CE Johnson wrote:
>> Hey All,
>>
>> [If you get something like six copies of this pleas forgive me. I'm
>> having a heck of a time posting today.]
>>
>> This one is whacky...
>>
>> I've got a project that has three sub-projects. We'll call them A, B
>> and C just for grins.
>>
>> Now...
>> Project A creates a jarfile (cleverly named A.jar)
>> To create that jar, A/project.xml lists a bunch of dependencies.
>> Anyone using that jar needs *some* of those dependencies at runtime.
>>
>> Which brings us to...
>> Project B creates an earfile (uncreatively named B.ear) of EJBs
>> B depends on A.jar at compiletime, so A.jar is in project.xml and is
>> marked with ear.bundle.jar == true.
>> At runtime, the earfile also needs to have the runtime-required files
>> on which A.jar depends.
>>
>> Finally...
>> Project C is a simple webapp that doesn't know diddly about A and only
>> uses the client-side jarfile from B.
>>
>> Where I'm going with this is that in B/project.xml I've had to
>> copy/paste a bunch of the dependencies in A/project.xml and add
>> ear.bundle.jar == true. I've heard something about project.xml
>> actually being a jelly script and, thus, executable. Can someone
>> suggest a clever way for B/project.xml to magically "import" the
>> proper dependencies from A/project.xml? (I don't mind adding
>> ear.bundle.jar or some other property to the appropriate dependencies
>> of B/project.xml if necessary.)
>
> <deploy:copy-deps
>   projectDescriptor="../B/project.xml"
>   todir="/wherever"/>
>
> The deploy:copy-deps will take an optional projectDescriptor which
> allows you to copy the deps of any POM wherever you want.

That's shoving files around on the filesystem then. Right?

>
> I use this in the plexus plugin to walk a chain a POMs and push deps
> where I like.

Can I copy the list of A's dependencies into B's ${pom.dependencies}?

In order to build the manifest for my EJB jar file I have this:

    <j:set var="ejb.classpath" value=''/>

    <j:forEach var="dep" items="${pom.dependencies}">
      <j:if test="${dep.getProperty('ear.bundle.jar')=='true'}">
        <j:set var="ejb.classpath"
               value="${ejb.classpath} ${dep.getArtifact()}"/>
      </j:if>
    </j:forEach>

    <echo file="${maven.build.dir}/ejb-manifest"
          message="Class-path: ${ejb.classpath}"/>

Then again within my <ear> task:
    <j:forEach var="dep" items="${pom.dependencies}">
      <j:if test="${dep.getProperty('ear.bundle.jar')=='true'}">
        <fileset dir="${maven.repo.local}/${dep.artifactDirectory}/jars/">
          <include name="${dep.artifact}"/>
        </fileset>
      </j:if>
    </j:forEach>

Or is there a better way to handle that? Maybe I could use
<deploy:copy-deps> to push the files around and then list that directory's
contents in order to build my manifest...

>
> Handling of these types of dependencies will get easier.
>
>> Thanks,
>> J
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
> --
> jvz.
>
> Jason van Zyl
> [EMAIL PROTECTED]
> http://tambora.zenplex.org
>
> In short, man creates for himself a new religion of a rational
> and technical order to justify his work and to be justified in it.
>
>   -- Jacques Ellul, The Technological Society


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to