Strange. I have no idea. I just tried on windows, and the scenario worked. If the zip is in the local repo, it skipped the remote download. When I deleted the zip from the local repo and reran, it pulled it down.

- sachin



On Dec 21, 2005, at 10:39 PM, Bill Stoddard wrote:

Sachin Patel (JIRA) wrote:
[ http://issues.apache.org/jira/browse/GERONIMODEVTOOLS-26? page=comments#action_12361088 ] Sachin Patel commented on GERONIMODEVTOOLS-26:
----------------------------------------------
This is incorrect. The current syntax is correct as is. If the zip is not available in the local repo, it will pull it down from cvs.apache.org


<j:if test="${zip.present != 'true'}">

Yikes, after spending a bit of time with google I agree the original syntax is correct, but it's not producing the desired result.

Here is the original maven goal with an ant:echo for instrumentation.
<goal name="getzip">
<ant:property name="geronimo.zip" value="geronimo-jetty-j2ee-$ {geronimo.version}.zip"/> <ant:available file="${maven.repo.local}/geronimo/distributions/ ${geronimo.zip}" property="zip.present"/>
    <ant:echo>zip.present is ${zip.present}</ant:echo>
    <j:if test="${zip.present != 'true'}">
<ant:mkdir dir="${maven.repo.local}/geronimo/ distributions/"/> <ant:get src="http://cvs.apache.org/repository/geronimo/ distributions/${geronimo.zip}" dest="${maven.repo.local}/geronimo/ distributions/${geronimo.zip}"/>
    </j:if>
    <ant:mkdir dir="${maven.build.dest}/zips"/>
<copy file="${maven.repo.local}/geronimo/distributions/$ {geronimo.zip}" todir="${maven.build.dest}/zips"/>
</goal>

Here is the resulting build failure:

C:\home\apache\devtools\modules\eclipse-plugin\plugins \org.apache.geronimo.j2ee.server.v1>maven
maven
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0.2

build:start:

default:
java:prepare-filesystem:

java:compile:
[echo] Compiling to C:\home\apache\devtools\modules\eclipse- plugin\plugins\org.apache.geronimo.j2ee.server.v1/target/classes
    [echo] No java source files to compile.

java:jar-resources:
getzip:
[echo] zip.present is true <=== geronimo- jetty-j2ee-1.0.zip is in my local repo [get] Getting: http://cvs.apache.org/repository/geronimo/ distributions/geronimo-jetty-j2ee-1.0.zip
    [get] Error opening connection java.io.IOException
    [get] Error opening connection java.io.IOException
    [get] Error opening connection java.io.IOException
[get] Can't get http://cvs.apache.org/repository/geronimo/ distributions/geronimo-jetty-j2ee-1.0.zip to C:\Documents and Settings\Administrator\.maven\repository\geronimo\distributions \geronimo-jetty-j2ee-1.0.zip <=== So why did we take the branch to download the zip?

BUILD FAILED
File...... C:\home\apache\devtools\modules\eclipse-plugin\plugins \org.apache.geronimo.j2ee.server.v1\maven.xml
Element... ant:get
Line...... 34
Column.... 164
Can't get http://cvs.apache.org/repository/geronimo/distributions/ geronimo-jetty-j2ee-1.0.zip to C:\Documents and Settings \Administrator\.maven\repository\geronimo\distributions\geronimo- jetty-j2ee-1.0.zip
Total time: 3 seconds
Finished at: Wed Dec 21 22:17:45 EST 2005


If I force maven to bypass the download of geronimo-jetty- j2ee-1.0.zip, my plugin build completes.

What am I missing??

Bill


Reply via email to