Thomas, 

I believe you are right and at least the last time I checked this was not
yet fixed. There is an additional dependency subtag called 'type' which you
should set to 'war' and a further one proposed (though may not be accepted)
called 'ext' which in this case you should also set to 'war'. The second one
is required since the extension does not always match the type

Unfortunately maven (currently) will still not download your dependency
though you should be right for the future!!

In the meantime if you _do_ insert the extra tags you can use the following
jelly script (for exmple as a preGoal in your maven.xml file) to get the
dependency you really want. 

Beware you will also need an updated jelly lib in your maven\lib if you are
running beta 7. Mail me if you'd like me to send you one that works (I'll
mail you directly rather than send the attachment to the list) 

    <goal name="dep:prepare-local-repository"
          description="Compensate for the maven bug that fails to download
non-jar artifacts">

      <u:tokenize var="listOfRepoRemote" delim=",
">${maven.repo.remote}</u:tokenize>

      <j:forEach var="dep" items="${pom.dependencies.iterator()}">
        <j:set var="artifactType" value="${dep.getType()}"/>
        <j:if test="${empty(artifactType)}">
          <j:set var="artifactType" value="jar"/>
        </j:if>
        <j:set var="ext" value="${dep.getExt()}"/>
        <j:if test="${empty(ext)}">
          <j:choose>
            <j:when test="${artifactType == 'ear'}">
              <j:set var="ext" value="ear"/>
            </j:when>
            <j:when test="${artifactType == 'war'}">
              <j:set var="ext" value="war"/>
            </j:when>
            <j:otherwise>
              <j:set var="ext" value="jar"/>
            </j:otherwise>
          </j:choose>
        </j:if>

        <!-- Test if jar is specified or if uses standard naming convention
-->
        <j:choose>
          <j:when test="${!empty(dep.getJar())}">
            <!-- Due to a maven bug 'dep.jar' always ends with '.jar' -->
            <j:set var="artifactFinalName"
value="${dep.getProjectId()}/${artifactType}s/${dep.jar.substring(0,
dep.jar.lastIndexOf('.'))}.${ext}"/>
          </j:when>
          <j:otherwise>
            <j:set var="artifactFinalName"
 
value="${dep.getProjectId()}/${artifactType}s/${dep.getProjectId()}-${dep.ge
tVersion()}.${ext}"/>
          </j:otherwise>
        </j:choose>

        <j:forEach var="repo" items="${listOfRepoRemote}">
          <!-- This is a non-standard available tag, jelly does not offer
the var attribute -->
          <u:available var="depAvail"
file="${maven.home}/repository/${artifactFinalName}"/>
          <j:if test="${depAvail != 'true'}">
            <echo message="Searching for dependency ${artifactFinalName}"/>
            <mkdir
dir="${maven.home}/repository/${dep.getProjectId()}/${artifactType}s"/>
            <get src="${repo}/${artifactFinalName}" 
               dest="${maven.home}/repository/${artifactFinalName}" 
               verbose="true"
               usetimestamp="true"
               ignoreerrors="true"/>
           </j:if>      
         </j:forEach>      
       </j:forEach>      
    </goal>



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, 22 January 2003 5:55 PM
To: [EMAIL PROTECTED]
Subject: Problem with EAR plugin.


Hi all,

I am trying to build a J2EE project with MAVEN. And I have a problem with
the ear plugin. I understand that you use dependencies to put a war  into
the ear with the following code :
     <dependency>
           <id>web-client</id>
           <version>1.0</version>
           <properties>
               <ear.bundle.war>true</ear.bundle.war>
           </properties>
      </dependency>
But my problem is that when downloading dependencies from the repository,
Maven thinks that it is a jar and not a war.That means Maven tries to
download web-client-1.0.jar instead of web-client-1.0.war. Is there anyway
to specify that this dependency is a war ?

Thanks for the help !






This message and any attachments (the "message") is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet can not
guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

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

Ce message et toutes les pieces jointes (ci-apres le 
"message") sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.


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



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

Reply via email to